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 @@