首先在web.php和console.php配置authmanager组件,web.php是应用配置文件,console.php是yii命令配置文件,都需要配置。

在components加入如下配置:

'authManager' => [
'class' => 'yii\rbac\DbManager',
'itemTable' => '{{%auth_item}}',
'itemChildTable' => '{{%auth_item_child}}',
'assignmentTable' => '{{%auth_assignment}}',
'ruleTable' => '{{%auth_rule}}',
'defaultRoles' => ['default'],
],

然后在@app目录执行命令:

php yii migrate --migrationPath=@yii/rbac/migrations

相关文章:

  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2021-06-13
  • 2021-05-27
  • 2022-12-23
  • 2021-08-06
猜你喜欢
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案