712120393

712120393

这家伙有点懒,还没写个性签名!

  • 财富值20
  • 威望值10
  • 总积分140

个人信息

  • 赞了回答

    很多人都遇到上面的问题:Exception 'yii\base\InvalidConfigException' with message 'You should configure "authManager" component to use database before executing this migration.'
    其实这里只是你的
    'authManager' => [

        'class' => 'yii\rbac\DbManager',
    ],
    

    配置放错位置了。深入源码你可以知道其实这里他找的配置文件是config/console.php里面的components组建。
    在里面加入:
    'authManager' => [

        'class' => 'yii\rbac\DbManager',
    ],
    

    就ok了

    $config = [
        'id' => 'basic-console',
        'basePath' => dirname(__DIR__),
        'bootstrap' => ['log'],
        'controllerNamespace' => 'app\commands',
        'components' => [
            'cache' => [
                'class' => 'yii\caching\FileCache',
            ],
            'authManager' => [
    	        'class' => 'yii\rbac\DbManager',
            ],
            'log' => [
                'targets' => [
                    [
                        'class' => 'yii\log\FileTarget',
                        'levels' => ['error', 'warning'],
                    ],
                ],
            ],
            'db' => $db,
        ],
        'params' => $params,
        /*
        'controllerMap' => [
            'fixture' => [ // Fixture generation command line.
                'class' => 'yii\faker\FixtureController',
            ],
        ],
        */
    ];
    
    
  • 回复了 的评论

    瞄了一眼,还是不错的。layui是授权版 ?

    python pa xia lai de

  • 发布了教程
    yii2-layuiadmin 后台权限管理
  • 2018-11-30 已签到
    连续签到1天,获得了5个金钱
助理 等级规则
140/200
资料完整度
10/100
用户活跃度
0/100

Ta的关注

0

Ta的粉丝

1

Ta的访客

3