Skip to content

Commit

Permalink
权限sql扩展统一移动后面避免与已有的固定id冲突
Browse files Browse the repository at this point in the history
  • Loading branch information
tangym committed Jan 29, 2023
1 parent e597c38 commit a53d0d5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
1 change: 0 additions & 1 deletion application/admin/controller/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
namespace app\admin\controller;

use app\api\library\RolePermission;
use app\common\model\AuthRuleModel;
use app\common\model\MenuModel;
use think\Controller;
use think\facade\Cache;
Expand Down
31 changes: 19 additions & 12 deletions data/install/utility/create_sys_menu_permission.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ begin
# 菜单初始化
truncate table sys_menu;

/*=============================api接口权限=============================*/
/*===============================================api接口权限=======================================================*/
/*================================================================================================================*/

/**************************一级菜单******************************/
INSERT INTO `sys_menu`(id,pid,title,name,component,path,icon,type,is_menu,permission,status,sort,belongs_to) VALUES (1, 0, '面板', 'Dashboard', 'dashboard/index', 'dashboard/index','el-icon-s-home', 1, 0, null, 1, 0, 'api');
Expand Down Expand Up @@ -198,18 +199,9 @@ INSERT INTO `sys_menu`(pid,title,name,component,path,icon,type,is_menu,permissio
(f1stmaxid, '平级菜单', 'pingji', 'empty/index', 'pingji/index', null, 1, 1, "", 1, 1, 'api')
;

/********************* 新增api扩展菜单或权限**********************/
# project api
#INSERT INTO `sys_menu`(pid,title,name,component,path,icon,type,is_menu,permission,status,sort,belongs_to) VALUES
#(0, 'project api', 'pcapi', 'Layout', 'pcapi', 'nested', 2, 0, "", 1, 999, 'api')
#;
#select max(id) from sys_menu into f1stmaxid;
#INSERT INTO `sys_menu`(pid,title,name,component,path,icon,type,is_menu,permission,status,sort,belongs_to) VALUES
#(f1stmaxid, '版本检查', '', null, '', null, 2, 0, "proj:api.app:checkVersion", 1, 0, 'api'),
#(f1stmaxid, 'ip查询', '', null, '', null, 2, 0, "proj:api.app:ip", 1, 0, 'api')
#;

/*=============================admin管理后台权限=============================*/
/*==============================================admin管理后台权限==================================================*/
/*================================================================================================================*/

/**************************一级菜单******************************/
INSERT INTO `sys_menu`(id,pid,title,path,icon,type,is_menu,sort,status,belongs_to) VALUES (20, 0, '综合面板', 'admin/ShowNav/Index', 'fa-th-large', 1, 1, 1, 1,'admin');
Expand Down Expand Up @@ -407,6 +399,21 @@ INSERT INTO `sys_menu`(pid,title,path,icon,type,is_menu,sort,status,belongs_to)
;


/*=========================api接口或admin管理后台权限扩展(避免与已有的固定id冲突)====================================*/
/*================================================================================================================*/

/********************* 新增api扩展菜单或权限**********************/
# project api
#INSERT INTO `sys_menu`(pid,title,name,component,path,icon,type,is_menu,permission,status,sort,belongs_to) VALUES
#(0, 'project api', 'pcapi', 'Layout', 'pcapi', 'nested', 2, 0, "", 1, 999, 'api')
#;
#select max(id) from sys_menu into f1stmaxid;
#INSERT INTO `sys_menu`(pid,title,name,component,path,icon,type,is_menu,permission,status,sort,belongs_to) VALUES
#(f1stmaxid, '版本检查', '', null, '', null, 2, 0, "proj:api.app:checkVersion", 1, 0, 'api'),
#(f1stmaxid, 'ip查询', '', null, '', null, 2, 0, "proj:api.app:ip", 1, 0, 'api')
#;


/********************* 新增admin扩展菜单或权限**********************/
#INSERT INTO `sys_menu`(pid,title,path,icon,type,is_menu,sort,status,belongs_to) VALUES (0, '一级菜单', 'admin/ShowNav/NewMenu', 'fa-th-large', 1, 1, 999, 1,'admin');
#select max(id) from sys_menu into f1stmaxid;
Expand Down

0 comments on commit a53d0d5

Please sign in to comment.