fix(install): check for .env file existence before installation
- Add a check for the presence of the .env file in the root directory - Update the index method to redirect to the admin page with a default value Signed-off-by: wolfcode <37436228+wolf-leo@users.noreply.github.com>
This commit is contained in:
@@ -14,6 +14,6 @@ class Index extends BaseController
|
||||
public function index(): Redirect
|
||||
{
|
||||
// 这是项目首页 系统默认跳转后台页面
|
||||
return redirect('/' . Env::get('EASYADMIN.ADMIN', false));
|
||||
return redirect('/' . Env::get('EASYADMIN.ADMIN', 'admin'));
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,9 @@ class Install extends BaseController
|
||||
}elseif (!extension_loaded("PDO")) {
|
||||
$errorInfo = '当前未开启PDO,无法进行安装';
|
||||
}
|
||||
if (!is_file(root_path() . '.env')) {
|
||||
$errorInfo = '.env 文件不存在,请先配置 .env 文件';
|
||||
}
|
||||
if (!$request->isAjax()) {
|
||||
$currentHost = '://';
|
||||
$result = compact('errorInfo', 'currentHost', 'isInstall');
|
||||
|
||||
Reference in New Issue
Block a user