重置权限缓存

master
ELF 4 years ago
parent d2c5ff923b
commit 6fcaa1362c

@ -1653,6 +1653,20 @@ function getPowerPromoteIds()
return $promoteIds;
}
function resetUserAuth()
{
$userAuth = session('user_auth');
$adminData = getAdminData($userAuth['uid']);
$groupId = getGameGroup($userAuth['uid']);
$userAuth['data_empower_type'] = $adminData['data_empower_type'];
$userAuth['data_president'] = $adminData['data_president'];
$userAuth['show_data'] = $adminData['show_data'];
session('user_group_id',$groupId);
session('user_auth', $userAuth);
session('user_auth_sign', data_auth_sign($userAuth));
session('user_auth_promote_ids', null);
}
/**
* 为数据权限添加筛选参数
* @param array $map 查询条件

@ -571,6 +571,9 @@ class AuthManagerController extends AdminController{
'data_president'=>$promoteData,
'show_data'=>$show_data
))) {
resetUserAuth();
addOperationLog(array(
"op_type"=>1,
"key"=> M("AuthGroup")->where("id={$gid}")->field("title")->find()['title'],

@ -1262,6 +1262,7 @@ class PromoteCompanyController extends ThinkController
$dataPresident = array_diff($dataPresident, $subPromoteIds);
}
M('auth_group',"sys_")->where(['title'=>'市场总监'])->save(['data_president'=>implode(',', $dataPresident)]);
resetUserAuth();
}
}
}

@ -47,6 +47,7 @@ class MarketService
$dataPresident = explode(',', $authGroup['data_president']);
if (!in_array($promote['id'], $dataPresident)) {
M('auth_group', 'sys_')->where(['title'=>'市场总监'])->save(['data_president' => $authGroup['data_president'] . ',' . $promote['id']]);
resetUserAuth();
}
}

@ -276,6 +276,7 @@ class PromoteCompanyService
$dataPresident = array_diff($dataPresident, $subPromoteIds);
}
M('auth_group', 'sys_')->where(['title' => '市场总监'])->save(['data_president' => implode(',', $dataPresident)]);
resetUserAuth();
}
}
}

@ -1032,6 +1032,7 @@ class PromoteService {
$id = M('promote', 'tab_')->getLastInsID();
$info = M('sys_auth_group')->where(['title'=>'市场总监'])->find();
M('sys_auth_group')->where(['title'=>'市场总监'])->save(['data_president'=>$info['data_president'].",".$id]);
resetUserAuth();
}
return $insert;

Loading…
Cancel
Save