作者 刘锟

小语种自定义跳转域名

... ... @@ -71,4 +71,21 @@ class ProjectCountryController extends BaseController
$projectCountryLogic->country_custom_del();
$this->response('success');
}
/**
* 获取语种自定义跳转链接详情
* @param ProjectCountryLogic $projectCountryLogic
* @author Akun
* @date 2024/03/06 14:37
*/
public function custom_info(ProjectCountryLogic $projectCountryLogic){
$this->request->validate([
'language_id'=>'required'
],[
'language_id.required' => 'language_id不能为空'
]);
$info = $projectCountryLogic->country_custom_info();
$this->response('success',Code::SUCCESS,$info);
}
}
... ...
... ... @@ -31,8 +31,6 @@ class ProjectCountryLogic extends BaseLogic
$lists['country_lists'] = $this->countryListsFormat($lists['country_lists']);
$lists['country_sort'] = $this->countrySortFormat($lists['country_sort']);
$custom_model = new CountryCustom();
$lists['country_custom'] = $custom_model->list(['project_id'=>$this->user['project_id']],'id',['language_id','custom_domain','is_create','type','private_key','private_cert']);
return $this->success($lists);
}
... ... @@ -90,6 +88,19 @@ class ProjectCountryLogic extends BaseLogic
return $this->success();
}
/**
* 获取语种自定义跳转详情
* @return array|bool
* @author Akun
* @date 2024/03/06 14:38
*/
public function country_custom_info(){
$custom_model = new CountryCustom();
$info = $custom_model->read(['project_id'=>$this->user['project_id'],'language_id'=>$this->param['language_id']],['language_id','custom_domain','is_create','type','private_key','private_cert']);
return $this->success($info?:[]);
}
protected function countryListsFormat($country_lists)
{
if(empty($country_lists)){
... ...
... ... @@ -158,6 +158,7 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/save', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'save'])->name('web_setting_country_save');
Route::any('/custom_save', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'custom_save'])->name('web_setting_country_custom_save');
Route::any('/custom_del', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'custom_del'])->name('web_setting_country_custom_del');
Route::any('/custom_info', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'custom_info'])->name('web_setting_country_custom_info');
});
//客服设置
Route::prefix('service')->group(function () {
... ...