Commit e8a6363a authored by hujun's avatar hujun

登录过期时间处理

parent 77e041fa
......@@ -188,12 +188,14 @@ class Basic extends Controller
if(empty($this->userName) || empty($this->userId) || empty($this->lastLoginTime) ){
$this->redirect('/index/login');
}
$time = time();
//登录有效期为2小时
if ((time() - $this->lastLoginTime) > 7200) {
if (($time - $this->lastLoginTime) > 7200) {
$this->redirect('/index/login');
} else {
//更新时间
Session::set("lastLoginTime",time());
Session::set("lastLoginTime", $time);
}
return ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment