This commit is contained in:
wispx 2018-12-01 15:50:12 +08:00
parent 884820af10
commit 715200c88d
2 changed files with 5 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class Base extends Controller
// 检测程序是否已安装
if (!file_exists(Env::get('config_path') . 'db.php')) {
return $this->redirect(url('/install'));
$this->redirect(url('/install'));
}
$configs = \app\common\model\Config::all();
@ -60,7 +60,7 @@ class Base extends Controller
// 检测数据库结构更新
if ($this->user && $this->user->is_admin) {
if (file_exists(Env::get('root_path') . 'update.sql')) {
return $this->redirect(url('/install/update'));
$this->redirect(url('/install/update'));
}
}

View File

@ -150,6 +150,9 @@ EOT;
Session::flash('install_success', true);
// 删除sql文件
@unlink($rootPath . 'install.sql');
if (file_exists($rootPath . 'update.sql')) {
@unlink($rootPath . 'update.sql');
}
// 删除session
Session::delete('db');
return $this->success('设置成功');