🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~[sql] CREATE TABLE `xi_admin` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(32) NOT NULL DEFAULT '' COMMENT '用户名', `password` char(32) NOT NULL DEFAULT '' COMMENT '密码', `auth_key` varchar(32) DEFAULT NULL COMMENT '认证密钥', `mobile` varchar(16) NOT NULL COMMENT '手机', `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序', `is_trash` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '删除,0=>否,1=>是', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态,0=>禁用,1=>启用', `created_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '创建时间', `updated_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '更新时间', PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), UNIQUE KEY `mobile` (`mobile`), UNIQUE KEY `auth_key` (`auth_key`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='平台用户'; ~~~ ~~~[sql] CREATE TABLE `xi_admin_auth_assignment` ( `admin_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '平台用户ID', `role_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '角色ID', `created_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '创建时间', UNIQUE KEY `admin_id` (`admin_id`,`role_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='平台权限分配'; ~~~ ~~~[sql] CREATE TABLE `xi_admin_auth_permission` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `menu_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '菜单ID', `title` varchar(32) NOT NULL DEFAULT '' COMMENT '标题', `module` varchar(64) NOT NULL DEFAULT '' COMMENT '模块', `controller` varchar(64) NOT NULL DEFAULT '' COMMENT '控制器', `name` varchar(64) NOT NULL DEFAULT '' COMMENT '规则唯一标识', `condition` varchar(128) NOT NULL COMMENT '规则表达式', `icon` varchar(16) NOT NULL DEFAULT '' COMMENT '图标', `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序', `is_menu_show` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否菜单显示', `is_trash` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '删除,0=>否,1=>是', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态,0=>禁用,1=>启用', `created_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '创建时间', `updated_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '更新时间', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`,`is_trash`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='平台权限条目'; ~~~ ~~~[sql] CREATE TABLE `xi_admin_auth_role` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(16) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '名称', `permissions` text CHARACTER SET utf8 NOT NULL COMMENT '权限', `description` varchar(128) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '描述', `is_trash` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '删除,0=>否,1=>是', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态,0=>禁用,1=>启用', `created_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '创建时间', `updated_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '更新时间', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`,`is_trash`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='平台权限角色'; ~~~ ~~~[sql] CREATE TABLE `xi_admin_menu` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `parent_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父ID', `name` varchar(16) NOT NULL DEFAULT '' COMMENT '名称', `module` varchar(32) NOT NULL DEFAULT '' COMMENT '模块', `icon` varchar(32) NOT NULL COMMENT '图标', `sort` tinyint(3) unsigned NOT NULL COMMENT '排序', `is_trash` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '删除,0=>否,1=>是', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态,0=>禁用,1=>启用', `created_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '创建时间', `updated_at` int(11) unsigned NOT NULL DEFAULT '1451577600' COMMENT '更新时间', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`,`parent_id`,`module`,`is_trash`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='平台菜单'; ~~~