瀏覽代碼

如果修改了部门,则清空权限

ith5 6 月之前
父節點
當前提交
6e4204acdc
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      plugin/saiadmin/app/logic/system/SystemUserLogic.php

+ 6 - 0
plugin/saiadmin/app/logic/system/SystemUserLogic.php

@@ -127,6 +127,12 @@ class SystemUserLogic extends BaseLogic
                     throw new ApiException('没有权限操作该角色数据');
                 }
             }
+            // 如果修改了部门,则清空权限
+            if ($user->dept_id != $data['dept_id']) {
+                $data['game_list'] = null;
+                $data['normal_game_list'] = null;
+                $data['ad_permission'] = null;
+            }
             $result = parent::edit($id, $data);
             if ($result) {
                 $user->roles()->detach();