From 6fcaa1362c8f7e281d38008a4eba906a696240d8 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Mon, 21 Sep 2020 14:05:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E6=9D=83=E9=99=90=E7=BC=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 14 ++++++++++++++ .../Controller/AuthManagerController.class.php | 3 +++ .../Controller/PromoteCompanyController.class.php | 1 + Application/Base/Service/MarketService.class.php | 1 + .../Base/Service/PromoteCompanyService.class.php | 1 + Application/Base/Service/PromoteService.class.php | 1 + 6 files changed, 21 insertions(+) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 39aa08532..b8814f0e9 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -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 查询条件 diff --git a/Application/Admin/Controller/AuthManagerController.class.php b/Application/Admin/Controller/AuthManagerController.class.php index c72fca0cf..cbd5bd396 100644 --- a/Application/Admin/Controller/AuthManagerController.class.php +++ b/Application/Admin/Controller/AuthManagerController.class.php @@ -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'], diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 0e0e997d3..f845ecbdb 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -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(); } } } diff --git a/Application/Base/Service/MarketService.class.php b/Application/Base/Service/MarketService.class.php index e68505fcd..522064a5f 100644 --- a/Application/Base/Service/MarketService.class.php +++ b/Application/Base/Service/MarketService.class.php @@ -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(); } } diff --git a/Application/Base/Service/PromoteCompanyService.class.php b/Application/Base/Service/PromoteCompanyService.class.php index a34dfe286..0cae4434e 100644 --- a/Application/Base/Service/PromoteCompanyService.class.php +++ b/Application/Base/Service/PromoteCompanyService.class.php @@ -276,6 +276,7 @@ class PromoteCompanyService $dataPresident = array_diff($dataPresident, $subPromoteIds); } M('auth_group', 'sys_')->where(['title' => '市场总监'])->save(['data_president' => implode(',', $dataPresident)]); + resetUserAuth(); } } } diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 39236b921..5c640d99c 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -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;