<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # :-: 設計 rbac 表結構 ## 需要四張表 ``` 1. 角色表 Roles 2. 權限表 Permissions 3. 用戶關聯角色 User_has_roles 4. 角色關聯權限 Role_has_permissions ``` ## migration 創建 具體表結構說明看的很清楚 ```php <?php use think\migration\Migrator; use think\migration\db\Column; use Phinx\Db\Adapter\MysqlAdapter; class Rbac extends Migrator { public function change() { $this->up(); } public function up() { $table = $this->table(config('permissions.table.role'), [ 'engine'=>'InnoDB']); $table->addColumn('name', 'string',['limit' => 50, 'default'=>'','comment'=>'角色名稱']) ->addColumn('created_at', 'timestamp', [ 'comment' => '創建時間']) ->addColumn('updated_at', 'timestamp', [ 'comment' => '更新時間']) ->addIndex(['name'], ['unique' => true]) ->create(); $table = $this->table(config('permissions.table.permission'), ['engine' => 'InnoDB']); $table->addColumn('name', 'string',['limit' => 50, 'default'=>'','comment'=>'菜單名稱']) ->addColumn('icon', 'string', ['limit' => 50, 'default'=>'', 'comment'=>'菜單圖標']) ->addColumn('pid', 'integer', ['limit' => MysqlAdapter::INT_SMALL, 'comment'=>'父級菜單ID']) ->addColumn('module', 'string',['limit' => 50, 'default'=>'','comment'=>'模塊名稱']) ->addColumn('controller', 'string',['limit' => 50, 'default'=>'','comment'=>'控制器名稱']) ->addColumn('action', 'string',['limit' => 50, 'default'=>'1','comment'=>'方法名稱']) ->addColumn('is_show', 'integer',['limit' => MysqlAdapter::INT_TINY, 'default'=> 1,'comment'=>'1 展示 2 隱藏']) ->addColumn('created_at', 'timestamp', [ 'comment' => '創建時間']) ->addColumn('updated_at', 'timestamp', [ 'comment' => '更新時間']) ->addIndex(['name'], ['unique' => true]) ->create(); $table = $this->table(config('permissions.table.user_has_roles'), ['engine' => 'InnoDB', 'identity' => true]); $table->addColumn('uid', 'integer',['limit' => 11, 'comment'=>'用戶ID']) ->addColumn('role_id', 'integer', [ 'comment' => '角色ID']) ->create(); $table = $this->table(config('permissions.table.role_has_permissions'), ['engine' => 'InnoDB', 'identity' => true]); $table->addColumn('role_id', 'integer',['limit' => 11, 'comment'=>'角色ID']) ->addColumn('permission_id', 'integer', [ 'comment' => '權限ID']) ->create(); } public function down() { } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看