重构安装方式

This commit is contained in:
WispX
2020-03-14 23:13:03 +08:00
parent c36831ccea
commit 4d28c60cb8
14 changed files with 166 additions and 188 deletions
+1 -13
View File
@@ -19,7 +19,7 @@ use think\facade\Env;
class Base extends Controller
{
protected $middleware = ['WebAuth'];
protected $middleware = ['Auth'];
protected $user = null;
@@ -40,11 +40,6 @@ class Base extends Controller
{
parent::initialize();
// 检测程序是否已安装
if (!file_exists(Env::get('config_path') . 'db.php')) {
if (!\config('app.app_debug')) $this->redirect(url('/install'));
}
$configs = \app\common\model\Config::all();
foreach ($configs as $key => &$value) {
$this->config[$value->name] = $value->value;
@@ -58,13 +53,6 @@ class Base extends Controller
}
}
// 检测数据库结构更新
if ($user && $user->is_admin) {
if (file_exists(Env::get('root_path') . 'update.sql') && !\config('app.app_debug')) {
$this->redirect(url('/install/update'));
}
}
$this->init($user);
$this->assign([