作者 lyh

gxA端页面通知

... ... @@ -62,11 +62,15 @@ class Validate
*/
public static function check_data($data,$type)
{
try {
if($type == 1){
$res = HttpUtils::get('https://fob.ai.cc/api/check_email', ['email' => $data]);
}else{
$res = HttpUtils::get('https://fob.ai.cc/api/check_phone', ['phone' => $data]);
}
}catch (\Exception $e){
return [];
}
return Arr::s2a($res);
}
}
... ...
... ... @@ -270,4 +270,21 @@ class InquiryController extends BaseController
// return Storage::disk('runtime')->download($file); //直接下载
$this->response('success',Code::SUCCESS,['url' => $fileurl]);
}
/**
* @remark :翻译国家
* @name :tranCountry
* @author :lyh
* @method :post
* @time :2025/3/11 14:18
*/
public function tranCountry(InquiryLogic $logic){
$this->request->validate([
'phone_region' => 'required',
],[
'phone_region.required' => '国家译文不能为空'
]);
$data = $logic->tranCountry();
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -212,10 +212,29 @@ class InquiryLogic extends BaseLogic
'country_code'=>$data['country_code'] ?? '',
'phone_region'=>$data['phone_region'] ?? '',
];
if(!empty($param['phone_region'])){
$param['country'] = Translate::tran($this->param['phone_region'], 'zh') ?? '';
}
(new PhoneData())->addReturnId($param);
return $this->success($param);
}
}
return $this->success($data);
}
/**
* @remark :翻译国家
* @name :tranCountry
* @author :lyh
* @method :post
* @time :2025/3/11 14:11
*/
public function tranCountry(){
$country = Translate::tran($this->param['phone_region'], 'zh') ?? '';
if(!empty($country)){
$phoneDataModel = new PhoneData();
$phoneDataModel->edit(['country'=>$country],['phone_region'=>$this->param['phone_region']]);
}
return $this->success(['country'=>$country]);
}
}
... ...
... ... @@ -371,6 +371,7 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/export', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'export'])->name('inquiry_export');
Route::any('/send', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'sendMobileVerifyData'])->name('inquiry_sendMobileVerifyData');
Route::any('/checkEmail', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'checkEmail'])->name('inquiry_checkEmail');
Route::any('/tranCountry', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'tranCountry'])->name('inquiry_tranCountry');
});
//生成路由
... ...