fix:安装

This commit is contained in:
atshike
2025-01-06 10:44:03 +08:00
parent 7ce973afc7
commit 5ccd3a7076
2 changed files with 6 additions and 3 deletions
@@ -120,6 +120,9 @@ class IndexController extends Controller
}
try {
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http';
$domain = $protocol.'://'.$_SERVER['HTTP_HOST'];
$this->updateEnv('APP_URL', $domain);
$this->updateEnv('DB_HOST', $params['host']);
$this->updateEnv('DB_PORT', $params['port']);
$this->updateEnv('DB_DATABASE', $params['name']);
@@ -142,12 +145,12 @@ 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)
->withErrors('sql_error:'.$e->getMessage())
->withErrors('安装失败!:'.$e->getMessage())
->withInput();
}