zoukankan      html  css  js  c++  java
  • tp5---auth权限搭建2

    1、auth权限
    composer auth库

    下载完成之后

    根据auth.php中所提及怎样创建表,就怎样建表

    2、安利一个简单的建表操作
    根据composer下载里的文件注释的代码,将其直接放到sql编辑器里就好

    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;

    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;


    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

  • 相关阅读:
    Codeforces 1265A Beautiful String
    1039 Course List for Student (25)
    1038 Recover the Smallest Number (30)
    1037 Magic Coupon (25)
    1024 Palindromic Number (25)
    1051 Pop Sequence (25)
    1019 General Palindromic Number (20)
    1031 Hello World for U (20)
    1012 The Best Rank (25)
    1011 World Cup Betting (20)
  • 原文地址:https://www.cnblogs.com/guoyinglichong/p/8214710.html
Copyright © 2011-2022 走看看