From 5ccd3a70761bcf8b565265e9f9ff7d4004aea64d Mon Sep 17 00:00:00 2001 From: atshike Date: Mon, 6 Jan 2025 10:44:03 +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 --- serve/app/Http/Controllers/Install/IndexController.php | 7 +++++-- serve/resources/views/install/step4.blade.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/serve/app/Http/Controllers/Install/IndexController.php b/serve/app/Http/Controllers/Install/IndexController.php index 36bb121..37feda8 100644 --- a/serve/app/Http/Controllers/Install/IndexController.php +++ b/serve/app/Http/Controllers/Install/IndexController.php @@ -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(); } diff --git a/serve/resources/views/install/step4.blade.php b/serve/resources/views/install/step4.blade.php index 5d2cab1..d8c0074 100644 --- a/serve/resources/views/install/step4.blade.php +++ b/serve/resources/views/install/step4.blade.php @@ -36,7 +36,7 @@
安装完成,进入管理后台
- 为了您站点的安全,安装完成后即可将网站根目录下的“install”文件夹删除,或者config/install.lock/目录下创建install.lock文件防止重复安装。 + 为了您站点的安全,安装完成后即可将网站根目录下的“install”文件夹删除。