From b861200cb607888e66b5ecabb87d490482eeb5ab Mon Sep 17 00:00:00 2001 From: atshike Date: Mon, 6 Jan 2025 11:24:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/Http/Controllers/Install/IndexController.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/serve/app/Http/Controllers/Install/IndexController.php b/serve/app/Http/Controllers/Install/IndexController.php index 37feda8..ef916cb 100644 --- a/serve/app/Http/Controllers/Install/IndexController.php +++ b/serve/app/Http/Controllers/Install/IndexController.php @@ -133,10 +133,14 @@ class IndexController extends Controller ->withErrors($e->getMessage()) ->withInput(); } + sleep(1); + Artisan::call('config:clear'); + Artisan::call('cache:clear'); + Artisan::call('storage:link'); + sleep(1); try { - DB::unprepared(file_get_contents(database_path('base.sql'))); - - DB::table('users')->insert([ + DB::connection('test')->unprepared(file_get_contents(database_path('base.sql'))); + DB::connection('test')->table('users')->insert([ 'username' => $params['admin_user'], 'password' => bcrypt($params['admin_password']), 'type' => UserType::Admin, @@ -145,8 +149,6 @@ class IndexController extends Controller 'created_at' => now(), 'updated_at' => now(), ]); - Artisan::call('storage:link'); - Artisan::call('cache:clear'); } catch (\Exception $e) { return redirect('install?step='.$step - 1)