Merge branch 'feature/promote' of 47.111.118.107:/srv/git/platform into feature/promote

master
ELF 5 years ago
commit ed2fbea24c

@ -383,7 +383,7 @@ class FinanceController extends ThinkController
if ($page == 1) { if ($page == 1) {
$parentData = $this->getParentSpendData($root_id,$month,2); $parentData = $this->getParentSpendData($root_id,$month,2);
} }
$map['chain'] =['like','%'.$root_id.'%']; $map['chain'] =['like','%/'.$root_id.'/%'];
$map['level'] = 2; $map['level'] = 2;
} else if(!empty(I("sign"))){ } else if(!empty(I("sign"))){
$map['parent_id'] = ['neq',0]; $map['parent_id'] = ['neq',0];
@ -461,7 +461,7 @@ class FinanceController extends ThinkController
if ($page == 1) { if ($page == 1) {
$parentData = $this->getParentSpendData($root_id,$month,3); $parentData = $this->getParentSpendData($root_id,$month,3);
} }
$map['chain'] =['like','%'.$root_id.'%']; $map['chain'] =['like','%/'.$root_id.'/%'];
$map['level'] = 3; $map['level'] = 3;
} else if(!empty(I("sign"))){ } else if(!empty(I("sign"))){
@ -539,7 +539,7 @@ class FinanceController extends ThinkController
$parentData = $this->getParentSpendData($parent_id,$month,4); $parentData = $this->getParentSpendData($parent_id,$month,4);
} }
$map['chain'] =['like','%'.$parent_id.'%']; $map['chain'] =['like','%/'.$parent_id.'/%'];
$map['level'] = 4; $map['level'] = 4;
} }

@ -79,7 +79,7 @@ class MemberModel extends Model {
); );
session('user_auth', $auth); session('user_auth', $auth);
session('user_auth_sign', data_auth_sign($auth)); session('user_auth_sign', data_auth_sign($auth));
setcookie(session_name(),session_id(),time()+3600); session('user_auth_expire', time());
} }
public function getNickName($uid){ public function getNickName($uid){

@ -23,10 +23,19 @@ const ONETHINK_ADDON_PATH = './Addons/';
*/ */
function is_login() function is_login()
{ {
// 判断是否过期 过期时间一个小时
$expire = 3600;
$user = session('user_auth'); $user = session('user_auth');
if (empty($user)) { if (empty($user)) {
return 0; return 0;
} else { } else {
if (time() - intval(session('user_auth_expire')) > $expire) { // 过期正则直接去除掉session 并且返回false
session('user_auth', null);
session('user_auth_sign', null);
return 0;
} else {
session('user_auth_expire', time() + $expire);
}
return session('user_auth_sign') == data_auth_sign($user) ? $user['uid'] : 0; return session('user_auth_sign') == data_auth_sign($user) ? $user['uid'] : 0;
} }
} }

Loading…
Cancel
Save