修改: 修改菜单表设计,关联VUE展示元素权限

This commit is contained in:
wangiegie@gmail.com 2017-11-08 19:50:13 +08:00
parent 8394ba93f7
commit 272b870205
1 changed files with 47 additions and 11 deletions

View File

@ -10,7 +10,7 @@ Target Server Type : MYSQL
Target Server Version : 50719
File Encoding : 65001
Date: 2017-11-01 17:40:14
Date: 2017-11-08 19:49:23
*/
SET FOREIGN_KEY_CHECKS=0;
@ -20,23 +20,41 @@ SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
`menu_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '菜单ID',
`menu_name` varchar(32) NOT NULL COMMENT '菜单名称',
`menu_desc` varchar(32) DEFAULT NULL COMMENT '菜单描述',
`url` varchar(128) DEFAULT NULL,
`menu_id` int(11) NOT NULL COMMENT '菜单ID',
`name` varchar(32) NOT NULL COMMENT '菜单名称',
`permission` varchar(32) DEFAULT NULL COMMENT '菜单权限标识',
`url` varchar(128) DEFAULT NULL COMMENT '请求链接',
`method` varchar(32) DEFAULT NULL COMMENT '请求方法',
`parent_id` int(11) DEFAULT NULL COMMENT '父菜单ID',
`icon` varchar(32) DEFAULT NULL COMMENT '图标',
`component` varchar(64) DEFAULT NULL COMMENT 'VUE页面',
`sort` int(11) DEFAULT NULL COMMENT '排序值',
`type` char(1) DEFAULT NULL COMMENT '菜单类型 0菜单 1按钮',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '0--正常 1--删除',
PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='菜单权限表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='菜单权限表';
-- ----------------------------
-- Records of sys_menu
-- ----------------------------
INSERT INTO `sys_menu` VALUES ('1', '用户', '/', '/user', null, null, null, '2017-10-31 21:56:27', null, '0');
INSERT INTO `sys_menu` VALUES ('1', '系统管理', null, null, null, '-1', null, null, null, null, '2017-11-07 20:56:00', '2017-11-07 20:58:37', '0');
INSERT INTO `sys_menu` VALUES ('2', '用户管理', null, '', null, '1', null, null, null, null, '2017-11-02 22:24:37', '2017-11-08 09:49:47', '0');
INSERT INTO `sys_menu` VALUES ('3', '菜单管理', null, null, null, '1', null, null, null, null, '2017-11-08 09:57:27', null, '0');
INSERT INTO `sys_menu` VALUES ('4', '角色管理', null, null, null, '1', null, null, null, null, '2017-11-08 10:13:37', null, '0');
INSERT INTO `sys_menu` VALUES ('21', '用户查看', null, '/admin/user/*', 'GET', '2', null, null, null, null, '2017-11-07 20:58:05', '2017-11-08 09:58:36', '0');
INSERT INTO `sys_menu` VALUES ('22', '用户新增', null, '/admin/user/*', 'POST', '2', null, null, null, null, '2017-11-08 09:52:09', '2017-11-08 09:57:06', '0');
INSERT INTO `sys_menu` VALUES ('23', '用户修改', null, '/admin/user/*', 'PUT', '2', null, null, null, null, '2017-11-08 09:52:48', '2017-11-08 09:57:08', '0');
INSERT INTO `sys_menu` VALUES ('24', '用户删除', null, '/admin/user/*', 'DELETE', '2', null, null, null, null, '2017-11-08 09:54:01', '2017-11-08 09:57:11', '0');
INSERT INTO `sys_menu` VALUES ('31', '菜单查看', null, '/admin/menu/*', 'GET', '3', null, null, null, null, '2017-11-08 09:57:56', '2017-11-08 09:58:29', '0');
INSERT INTO `sys_menu` VALUES ('32', '菜单新增', null, '/admin/menu/*', 'POST', '3', null, null, null, null, '2017-11-08 10:15:53', '2017-11-08 10:16:04', '0');
INSERT INTO `sys_menu` VALUES ('33', '菜单修改', null, '/admin/menu/*', 'PUT', '3', null, null, null, null, '2017-11-08 10:16:23', null, '0');
INSERT INTO `sys_menu` VALUES ('34', '菜单删除', null, '/admin/menu/*', 'DELETE', '3', null, null, null, null, '2017-11-08 10:16:43', null, '0');
INSERT INTO `sys_menu` VALUES ('41', '角色查看', null, '/admin/role/*', 'GET', '4', null, null, null, null, '2017-11-08 10:14:01', '2017-11-08 10:15:19', '0');
INSERT INTO `sys_menu` VALUES ('42', '角色新增', null, '/admin/role/*', 'POST', '4', null, null, null, null, '2017-11-08 10:14:18', '2017-11-08 10:15:21', '0');
INSERT INTO `sys_menu` VALUES ('43', '角色修改', null, '/admin/role/*', 'PUT', '4', null, null, null, null, '2017-11-08 10:14:41', '2017-11-08 10:15:25', '0');
INSERT INTO `sys_menu` VALUES ('44', '角色删除', null, '/admin/role/*', 'DELETE', '4', null, null, null, null, '2017-11-08 10:14:59', '2017-11-08 10:15:35', '0');
-- ----------------------------
-- Table structure for sys_role
@ -52,12 +70,14 @@ CREATE TABLE `sys_role` (
`del_flag` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '删除标识0-正常,1-删除)',
PRIMARY KEY (`role_id`),
UNIQUE KEY `role_idx1_role_code` (`role_code`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of sys_role
-- ----------------------------
INSERT INTO `sys_role` VALUES ('1', 'admin', 'admin', null, '2017-10-29 15:45:51', null, '0');
INSERT INTO `sys_role` VALUES ('1', 'admin', 'admin', '多撒DSA', '2017-10-29 15:45:51', '2017-11-06 22:09:10', '0');
INSERT INTO `sys_role` VALUES ('2', 'user', 'user', '普通用户角色', '2017-11-06 22:02:21', '2017-11-06 22:19:53', '1');
INSERT INTO `sys_role` VALUES ('4', 'test', 'test', '测试角色!!!', '2017-11-06 22:03:54', '2017-11-06 22:19:51', '1');
-- ----------------------------
-- Table structure for sys_role_menu
@ -73,6 +93,20 @@ CREATE TABLE `sys_role_menu` (
-- Records of sys_role_menu
-- ----------------------------
INSERT INTO `sys_role_menu` VALUES ('1', '1');
INSERT INTO `sys_role_menu` VALUES ('1', '2');
INSERT INTO `sys_role_menu` VALUES ('1', '3');
INSERT INTO `sys_role_menu` VALUES ('1', '21');
INSERT INTO `sys_role_menu` VALUES ('1', '22');
INSERT INTO `sys_role_menu` VALUES ('1', '23');
INSERT INTO `sys_role_menu` VALUES ('1', '24');
INSERT INTO `sys_role_menu` VALUES ('1', '31');
INSERT INTO `sys_role_menu` VALUES ('1', '32');
INSERT INTO `sys_role_menu` VALUES ('1', '33');
INSERT INTO `sys_role_menu` VALUES ('1', '34');
INSERT INTO `sys_role_menu` VALUES ('1', '41');
INSERT INTO `sys_role_menu` VALUES ('1', '42');
INSERT INTO `sys_role_menu` VALUES ('1', '43');
INSERT INTO `sys_role_menu` VALUES ('1', '44');
-- ----------------------------
-- Table structure for sys_user
@ -88,12 +122,12 @@ CREATE TABLE `sys_user` (
`del_flag` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '0-正常1-删除',
PRIMARY KEY (`user_id`),
UNIQUE KEY `user_idx1_username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户表';
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户表';
-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO `sys_user` VALUES ('1', 'admin', 'admin', null, '2017-10-29 15:45:13', null, '0');
INSERT INTO `sys_user` VALUES ('1', 'admin', '123456', null, '2017-10-29 15:45:13', '2017-11-06 00:15:05', '0');
-- ----------------------------
-- Table structure for sys_user_role
@ -109,3 +143,5 @@ CREATE TABLE `sys_user_role` (
-- Records of sys_user_role
-- ----------------------------
INSERT INTO `sys_user_role` VALUES ('1', '1');
INSERT INTO `sys_user_role` VALUES ('19', '1');
INSERT INTO `sys_user_role` VALUES ('20', '1');