From 8058ba312b181336daf23aa7640ad8026795ae0f Mon Sep 17 00:00:00 2001 From: Karson Date: Fri, 28 Aug 2020 14:58:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B3=A8=E5=86=8C=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E5=90=8E=E7=99=BB=E5=BD=95=E7=8A=B6=E6=80=81=E6=9C=AA?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E7=9A=84BUG=20=E4=BC=98=E5=8C=96=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E8=84=9A=E6=9C=AC=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/library/Auth.php | 3 +++ public/admin.php | 8 ++++---- public/index.php | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/application/common/library/Auth.php b/application/common/library/Auth.php index 4356bac2..89818705 100644 --- a/application/common/library/Auth.php +++ b/application/common/library/Auth.php @@ -179,6 +179,9 @@ class Auth $this->_token = Random::uuid(); Token::set($this->_token, $user->id, $this->keeptime); + //设置登录状态 + $this->_logined = true; + //注册成功的事件 Hook::listen("user_register_successed", $this->_user, $data); Db::commit(); diff --git a/public/admin.php b/public/admin.php index e7f4e66d..8a28a77e 100644 --- a/public/admin.php +++ b/public/admin.php @@ -11,14 +11,14 @@ // +---------------------------------------------------------------------- // [ 后台入口文件 ] // 使用此文件可以达到隐藏admin模块的效果 -// 建议将admin.php改成其它任意的文件名,同时修改config.php中的'deny_module_list',把admin模块也添加进去 +// 为了你的安全,强烈不建议将此文件名修改成admin.php // 定义应用目录 define('APP_PATH', __DIR__ . '/../application/'); // 判断是否安装 -if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) -{ - header("location:./install.php"); +if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) { + $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); + header("Location: {$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}{$uri}/install.php"); exit; } diff --git a/public/index.php b/public/index.php index 6139e4d2..8211765f 100755 --- a/public/index.php +++ b/public/index.php @@ -14,9 +14,9 @@ define('APP_PATH', __DIR__ . '/../application/'); // 判断是否安装 -if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) -{ - header("location:./install.php"); +if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) { + $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); + header("Location: {$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}{$uri}/install.php"); exit; }