From 6d4c9ba9a7034ee5f394cf02a32795b4cd9a3634 Mon Sep 17 00:00:00 2001 From: TL Date: Mon, 6 Feb 2023 16:02:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E8=A3=85=E7=A8=8B=E5=BA=8F=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E8=AF=AD=E8=A8=80=E6=94=B9=E4=B8=BA=E4=B8=AD=E6=96=87?= =?UTF-8?q?=EF=BC=8C=E4=B8=94=E5=90=8E=E5=8F=B0=E6=A0=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=AF=AD=E8=A8=80=E6=A0=B9=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E8=AF=AD=E8=A8=80=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Middleware/SetLocaleInstaller.php | 4 ++-- beike/Installer/Controllers/DatabaseController.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Middleware/SetLocaleInstaller.php b/app/Http/Middleware/SetLocaleInstaller.php index 2f8267c2..97955f2d 100644 --- a/app/Http/Middleware/SetLocaleInstaller.php +++ b/app/Http/Middleware/SetLocaleInstaller.php @@ -18,7 +18,7 @@ class SetLocaleInstaller */ public function handle(Request $request, Closure $next) { - $locale = $_COOKIE['locale'] ?? 'en'; + $locale = $_COOKIE['locale'] ?? 'zh_cn'; $languageDir = base_path('beike/Installer/Lang'); $languages = array_values(array_diff(scandir($languageDir), ['..', '.'])); @@ -27,7 +27,7 @@ class SetLocaleInstaller if ($locale && in_array($locale, $languages)) { App::setLocale($locale); } else { - App::setLocale('en'); + App::setLocale('zh_cn'); } return $next($request); diff --git a/beike/Installer/Controllers/DatabaseController.php b/beike/Installer/Controllers/DatabaseController.php index 5c19af8f..0b1a2422 100644 --- a/beike/Installer/Controllers/DatabaseController.php +++ b/beike/Installer/Controllers/DatabaseController.php @@ -58,7 +58,7 @@ class DatabaseController extends Controller 'name' => substr($email, 0, strpos($email, '@')), 'email' => $email, 'password' => request('admin_password'), - 'locale' => session('locale') ?? 'en', + 'locale' => session('locale') ?? 'zh_cn', 'active' => true, ]; AdminUserRepo::createAdminUser($data);