tp5---auth权限搭建2

1、auth权限
composer auth库
918768-20180106170552909-1929648718.png
下载完成之后
918768-20180106170654237-189505502.png
根据auth.php中所提及怎样创建表,就怎样建表
918768-20180106170829253-833554322.png
2、安利一个简单的建表操作
根据composer下载里的文件注释的代码,将其直接放到sql编辑器里就好
918768-20180109205422488-1411335597.png

CREATE TABLE think_auth_rule (
id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
name char(80) NOT NULL DEFAULT '',
title char(20) NOT NULL DEFAULT '',
type tinyint(1) NOT NULL DEFAULT '1',
status tinyint(1) NOT NULL DEFAULT '1',
condition char(100) NOT NULL DEFAULT '', # 规则附件条件,满足附加条件的规则,才认为是有效的规则
PRIMARY KEY (id),
UNIQUE KEY name (name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
918768-20180109205503754-551325524.png
CREATE TABLE think_auth_group (
id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
title char(100) NOT NULL DEFAULT '',
status tinyint(1) NOT NULL DEFAULT '1',
rules char(80) NOT NULL DEFAULT '',
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

918768-20180109205630301-1056278604.png
CREATE TABLE think_auth_group_access (
uid mediumint(8) unsigned NOT NULL,
group_id mediumint(8) unsigned NOT NULL,
UNIQUE KEY uid_group_id (uid,group_id),
KEY uid (uid),
KEY group_id (group_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

修改配置config.php
918768-20180111122752191-261150027.png

转载于:https://www.cnblogs.com/guoyinglichong/p/8214710.html

已标记关键词 清除标记
表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页