Skip to content

Commit

Permalink
feat: 处理可能存在的多语言问题
Browse files Browse the repository at this point in the history
  • Loading branch information
slowlyo committed May 31, 2024
1 parent 05158c5 commit b425e16
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ public function settings(): JsonResponse|JsonResource
'zh_CN' => '简体中文',
];

$locale = settings()->get('admin_locale', config('app.locale'));

if($locale == 'null'){
$locale = 'zh_CN';
}

return $this->response()->success([
'nav' => Admin::getNav(),
'assets' => Admin::getAssets(),
'app_name' => Admin::config('admin.name'),
'locale' => settings()->get('admin_locale', config('app.locale')),
'locale' => $locale,
'layout' => Admin::config('admin.layout'),
'logo' => url(Admin::config('admin.logo')),

Expand Down

0 comments on commit b425e16

Please sign in to comment.