作者 Karson

修复注册成功后登录状态未变更的BUG

优化安装脚本跳转
@@ -179,6 +179,9 @@ class Auth @@ -179,6 +179,9 @@ class Auth
179 $this->_token = Random::uuid(); 179 $this->_token = Random::uuid();
180 Token::set($this->_token, $user->id, $this->keeptime); 180 Token::set($this->_token, $user->id, $this->keeptime);
181 181
  182 + //设置登录状态
  183 + $this->_logined = true;
  184 +
182 //注册成功的事件 185 //注册成功的事件
183 Hook::listen("user_register_successed", $this->_user, $data); 186 Hook::listen("user_register_successed", $this->_user, $data);
184 Db::commit(); 187 Db::commit();
@@ -11,14 +11,14 @@ @@ -11,14 +11,14 @@
11 // +---------------------------------------------------------------------- 11 // +----------------------------------------------------------------------
12 // [ 后台入口文件 ] 12 // [ 后台入口文件 ]
13 // 使用此文件可以达到隐藏admin模块的效果 13 // 使用此文件可以达到隐藏admin模块的效果
14 -// 建议将admin.php改成其它任意的文件名,同时修改config.php中的'deny_module_list',把admin模块也添加进去 14 +// 为了你的安全,强烈不建议将此文件名修改成admin.php
15 // 定义应用目录 15 // 定义应用目录
16 define('APP_PATH', __DIR__ . '/../application/'); 16 define('APP_PATH', __DIR__ . '/../application/');
17 17
18 // 判断是否安装 18 // 判断是否安装
19 -if (!is_file(APP_PATH . 'admin/command/Install/install.lock'))  
20 -{  
21 - header("location:./install.php"); 19 +if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
  20 + $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
  21 + header("Location: {$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}{$uri}/install.php");
22 exit; 22 exit;
23 } 23 }
24 24
@@ -14,9 +14,9 @@ @@ -14,9 +14,9 @@
14 define('APP_PATH', __DIR__ . '/../application/'); 14 define('APP_PATH', __DIR__ . '/../application/');
15 15
16 // 判断是否安装 16 // 判断是否安装
17 -if (!is_file(APP_PATH . 'admin/command/Install/install.lock'))  
18 -{  
19 - header("location:./install.php"); 17 +if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
  18 + $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
  19 + header("Location: {$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}{$uri}/install.php");
20 exit; 20 exit;
21 } 21 }
22 22