## 数据库
#### auth_rule表:
~~~
CREATE TABLE `hui_auth_rule` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`type` enum('menu','file') NOT NULL DEFAULT 'file' COMMENT 'menu为菜单,file为权限节点',
`pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父ID',
`name` varchar(100) NOT NULL DEFAULT '' COMMENT '规则名称',
`title` varchar(50) NOT NULL DEFAULT '' COMMENT '规则名称',
`icon` varchar(50) NOT NULL DEFAULT '' COMMENT '图标',
`condition` varchar(255) NOT NULL DEFAULT '' COMMENT '条件',
`remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
`ismenu` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否为菜单',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
`updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
`weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
`status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `name` (`name`) USING BTREE,
KEY `pid` (`pid`) USING BTREE,
KEY `weigh` (`weigh`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='节点表';
~~~
写入数据:
~~~
INSERT INTO `hui_auth_rule` VALUES (1, 'file', 0, 'general', '常规管理', 'icon-settings', '', '', 1, 1497429920, 1497430169, 1, 'normal');
INSERT INTO `hui_auth_rule` VALUES (2, 'file', 0, 'auth', '权限管理', 'icon-group', '', '', 1, 1497429920, 1577703004, 2, 'normal');
INSERT INTO `hui_auth_rule` VALUES (3, 'file', 2, 'auth/admin', '管理员管理', 'icon-friendfill', '', 'Admin tips', 1, 1497429920, 1577703009, 1, 'normal');
INSERT INTO `hui_auth_rule` VALUES (4, 'file', 1, 'auth/adminlog', '管理员日志', 'icon-subscription_light\r\n', '', 'Admin log tips', 1, 1497429920, 1497430307, 99, 'normal');
INSERT INTO `hui_auth_rule` VALUES (5, 'file', 2, 'auth/group', '角色组', 'icon-group_fill_light', '', 'Group tips', 1, 1497429920, 1577703013, 2, 'normal');
INSERT INTO `hui_auth_rule` VALUES (6, 'file', 2, 'auth/rule', '菜单规则', 'icon-sort', '', 'Rule tips', 1, 1497429920, 1497430581, 3, 'normal');
INSERT INTO `hui_auth_rule` VALUES (7, 'file', 6, 'auth/rule_switch_field', '更改状态', 'icon-round_text_fill', '', '', 0, NULL, 1577703022, 0, 'normal');
INSERT INTO `hui_auth_rule` VALUES (8, 'file', 6, 'auth/rule_order', '排序', 'icon-round_text_fill', '', '', 0, 1577603451, 1577703026, 2, 'normal');
INSERT INTO `hui_auth_rule` VALUES (9, 'file', 6, 'auth/rule_add', '添加菜单规则', 'icon-round_text_fill', '', '', 0, 1577610841, 1577777054, 3, 'normal');
INSERT INTO `hui_auth_rule` VALUES (10, 'file', 6, 'auth/rule_edit', '修改菜单规则', 'icon-round_text_fill', '', '', 0, 1577756921, 1577777063, 4, 'normal');
INSERT INTO `hui_auth_rule` VALUES (11, 'file', 6, 'rule/rule_delete', '删除菜单规则', 'icon-round_text_fill', '', '', 0, 1577756963, 1577777069, 5, 'normal');
INSERT INTO `hui_auth_rule` VALUES (12, 'file', 5, 'auth/group_add', '添加角色组', 'icon-round_text_fill', '', '', 0, 1577777043, 1577777085, 1, 'normal');
INSERT INTO `hui_auth_rule` VALUES (13, 'file', 5, 'auth/group_edit', '修改角色组', 'icon-round_text_fill', '', '', 0, 1577777099, NULL, 2, 'normal');
INSERT INTO `hui_auth_rule` VALUES (14, 'file', 5, 'auth/group_delete', '删除角色组', 'icon-round_text_fill', '', '', 0, 1577777115, NULL, 3, 'normal');
~~~
****
## auth_group_access表:
~~~
CREATE TABLE `hui_auth_group_access` (
`uid` int(10) unsigned NOT NULL COMMENT '会员ID',
`group_id` int(10) unsigned NOT NULL COMMENT '级别ID',
UNIQUE KEY `uid_group_id` (`uid`,`group_id`) USING BTREE,
KEY `uid` (`uid`) USING BTREE,
KEY `group_id` (`group_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='权限分组表';
~~~
## auth_group表:
~~~
CREATE TABLE `hui_auth_group` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父组别',
`name` varchar(100) NOT NULL DEFAULT '' COMMENT '组名',
`rules` text NOT NULL COMMENT '规则ID',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
`updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
`status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='分组表';
~~~
写入数据
~~~
INSERT INTO `1055tp5_test`.`hui_auth_group`(`id`, `pid`, `name`, `rules`, `createtime`, `updatetime`, `status`) VALUES (1, 0, '超级管理员', '*', 1490883540, 149088354, 'normal');
INSERT INTO `1055tp5_test`.`hui_auth_group`(`id`, `pid`, `name`, `rules`, `createtime`, `updatetime`, `status`) VALUES (2, 1, '项目总监', '1,4,2,3,5,12,13', 1490883540, 1577868110, 'normal');
~~~
## admin表:
~~~
CREATE TABLE `hui_admin` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`username` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名',
`nickname` varchar(50) NOT NULL DEFAULT '' COMMENT '昵称',
`password` varchar(32) NOT NULL DEFAULT '' COMMENT '密码',
`salt` varchar(30) NOT NULL DEFAULT '' COMMENT '密码盐',
`avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '头像',
`email` varchar(100) NOT NULL DEFAULT '' COMMENT '电子邮箱',
`loginfailure` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '失败次数',
`logintime` int(10) DEFAULT NULL COMMENT '登录时间',
`loginip` varchar(50) DEFAULT NULL COMMENT '登录IP',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
`updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
`token` varchar(59) NOT NULL DEFAULT '' COMMENT 'Session标识',
`status` varchar(30) NOT NULL DEFAULT 'normal' COMMENT '状态',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `username` (`username`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='管理员表';
~~~
写入数据:
~~~
INSERT INTO `1055tp5_test`.`hui_admin`(`id`, `username`, `nickname`, `password`, `salt`, `avatar`, `email`, `loginfailure`, `logintime`, `loginip`, `createtime`, `updatetime`, `token`, `status`) VALUES (1, 'admin', 'Admin', 'fffe69302908dafc83cecc5686608ac7', 'zsmQ5v', '/assets/img/avatar.png', 'admin@fastadmin.net', 0, 1577328226, '127.0.0.1', 1492186163, 1577328226, '62465acf-babd-44d8-96a1-51535702f218', 'normal');
~~~