Commit 7102c317 authored by hujun's avatar hujun

[0]

parent 684b6e43
......@@ -217,7 +217,7 @@ class RedisCacheService
if (!empty($data)) {
$this->setRedisCache($this->group_key . $group_id, $data[0]);
}
return $data;
return $data[0];
}
/**
......@@ -342,6 +342,8 @@ class RedisCacheService
$result = $this->redis_ext->get($this->group_site_key.$id);
if (empty($result)) {
$result = $this->groupSiteCache($id);
} else {
$result = json_decode($result);
}
break;
default :
......
......@@ -46,11 +46,8 @@ class Login extends Basic
*/
public function login()
{
Session::clear();
$this->assign('mac_address',$this->params['mac_address'] ? $this->params['mac_address']: '');
$expire_time = Session::get("expire_time");
if ($expire_time > time()) {
$this->redirect('/admin.php/index/mainIndex');
}
return view("/login/login");
}
......
......@@ -139,9 +139,6 @@ class Basic extends Controller
*
* @param $requestPath
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function userAuth($requestPath){
$session_menu = Session::get("user_info.menu");
......@@ -176,9 +173,9 @@ class Basic extends Controller
// $agents = new AAgents();
// $is_auth = $agents->agentsAuth($auth_id, $this->userId);
// $is_auth = empty($is_auth['id']) ? 0:1;
/*读缓存 start*/
$redis_cache = new RedisCacheService();
$agent_data = $redis_cache->getRedisCache(2, $this->userId);
if ($agent_data['auth_group_id']) {
$group_data = $redis_cache->getRedisCache(3, $agent_data['auth_group_id']);
if ($group_data['rules']) {
......@@ -188,6 +185,7 @@ class Basic extends Controller
}
}
}
/*读缓存 end*/
if ($is_auth == 0) {
//处理盘方编辑商铺
......@@ -285,7 +283,7 @@ class Basic extends Controller
$expire = Config::get('session.expire');
$expire = empty($expire) ? 7200 : $expire;
Cookie::set('PHPSESSID', session_id(), $expire); //更新session_id过期时间
Session::set("expire_time", time() + $expire - 300); //更新过期时间
Session::set("expire_time", time() + $expire - 900); //更新过期时间
}
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