From 50eb87d82d1272eb66edf4be3a5be64af635f19a Mon Sep 17 00:00:00 2001 From: hdm Date: Sat, 12 Feb 2022 14:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=A8=A1=E5=9D=97=E9=99=90?= =?UTF-8?q?=E5=88=B6=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/home/controller/Module.php | 5 +++-- app/home/controller/Role.php | 1 - app/install/data/gouguoa.sql | 6 +++--- app/user/controller/User.php | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/home/controller/Module.php b/app/home/controller/Module.php index af7de6c..ca0ba85 100644 --- a/app/home/controller/Module.php +++ b/app/home/controller/Module.php @@ -34,8 +34,9 @@ class Module extends BaseController if (request()->isAjax()) { $param['name'] = preg_replace('# #','',$param['name']); if ($param['id'] > 0) { - if($param['id'] == 1 || $param['id'] == 2){ - return to_assign(1,'系统默认模块不能编辑'); + $module = Db::name('AdminModule')->where('id',$param['id'])->find(); + if($module['type'] == 1){ + return to_assign(1,'系统模块不能编辑'); } try { validate(ModuleCheck::class)->scene('edit')->check($param); diff --git a/app/home/controller/Role.php b/app/home/controller/Role.php index c0aabaa..1838fd9 100644 --- a/app/home/controller/Role.php +++ b/app/home/controller/Role.php @@ -68,7 +68,6 @@ class Role extends BaseController } //清除菜单\权限缓存 clear_cache('adminMenu'); - clear_cache('adminRules'); return to_assign(); } else { $id = isset($param['id']) ? $param['id'] : 0; diff --git a/app/install/data/gouguoa.sql b/app/install/data/gouguoa.sql index 372f7bd..808d282 100644 --- a/app/install/data/gouguoa.sql +++ b/app/install/data/gouguoa.sql @@ -160,9 +160,9 @@ INSERT INTO `oa_admin_rule` VALUES (9, 0, '', '财务管理', '财务管理', 'C INSERT INTO `oa_admin_rule` VALUES (10, 0, '', '商业智能', '商业智能', 'BI', 'icon-jiaoxuetongji', 1, 10, 1, 0, 0); INSERT INTO `oa_admin_rule` VALUES (11, 1, 'home/conf/index', '系统配置', '系统配置', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (12, 11, 'home/conf/add', '新建/编辑配置项', '配置项', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (13, 11, 'home/conf/edit', '编辑配置详情', '配置详情', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (14, 11, 'home/conf/delete', '删除配置项', '配置项', 'HOME', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (12, 11, 'home/conf/add', '新建/编辑', '配置项', 'HOME', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (13, 11, 'home/conf/delete', '删除', '配置项', 'HOME', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (14, 11, 'home/conf/edit', '编辑', '配置详情', 'HOME', '', 2, 1, 1, 0, 0); INSERT INTO `oa_admin_rule` VALUES (15, 1, 'home/module/index', '功能模块', '功能模块', 'HOME', '', 1, 1, 1, 0, 0); INSERT INTO `oa_admin_rule` VALUES (16, 15, 'home/module/add', '新建/编辑', '功能模块', 'HOME', '', 2, 1, 1, 0, 0); diff --git a/app/user/controller/User.php b/app/user/controller/User.php index 418f0c5..80502b1 100644 --- a/app/user/controller/User.php +++ b/app/user/controller/User.php @@ -88,7 +88,6 @@ class User extends BaseController add_log('edit', $param['id'], $param); //清除菜单\权限缓存 clear_cache('adminMenu'); - clear_cache('adminRules'); // 提交事务 Db::commit(); } catch (\Exception $e) {