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();
}
@@ -36,7 +36,7 @@
<div class="success-content">
<div class="mt16 result">安装完成,进入管理后台</div>
<div class="tips">
为了您站点的安全,安装完成后即可将网站根目录下的“install”文件夹删除,或者config/install.lock/目录下创建install.lock文件防止重复安装。
为了您站点的安全,安装完成后即可将网站根目录下的“install”文件夹删除。
</div>
<div class="btn-group">
<a class="btn" href="/" style="margin-left: 20px;">进入首页</a>