fix:admin域名更改

This commit is contained in:
atshike
2025-01-06 11:48:15 +08:00
parent b861200cb6
commit d269bed575
@@ -128,6 +128,17 @@ class IndexController extends Controller
$this->updateEnv('DB_DATABASE', $params['name']);
$this->updateEnv('DB_USERNAME', $params['user']);
$this->updateEnv('DB_PASSWORD', $params['password']);
$base_path = base_path();
$new_path = str_replace('/serve', '/admin/dist/config.js', $base_path);
$content = File::get($new_path);
if (!str_contains($content, $domain)) {
File::put($new_path, "window.config = {
// 你的后端域名
url: '{$domain}/api'
}");
}
} catch (\Exception $e) {
return redirect('install?step='.$step - 1)
->withErrors($e->getMessage())