exoodev / yii2-system

关于此包的最新版本(1.0.3)没有可用的许可证信息。

Yii2框架的系统扩展

安装: 8

依赖者: 0

建议者: 0

安全: 0

星标: 0

分支: 0

类型:yii2-extension

1.0.3 2019-05-20 09:56 UTC

This package is auto-updated.

Last update: 2024-09-25 22:28:41 UTC


README

========================

安装

安装此扩展的首选方式是通过 composer

运行以下命令之一:

php composer.phar require --prefer-dist exoo/yii2-system

或添加

"exoo/yii2-system": "*"

到您的 composer.json 文件的要求部分。

使用方法

  1. 示例后端配置
return [
    'modules' => [
        'system' => [
            'class' => 'exoo\system\Module',
            'isBackend' => true,
        ],
    ],
    'components' => [
        'user' => [
            'identityClass' => 'exoo\system\models\User',
            'enableAutoLogin' => true,
            'loginUrl' => ['/system/site/login'],
            'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
        ],
    ],
];
  1. 示例前端配置
return [
    'modules' => [
        'system' => [
            'class' => 'exoo\system\Module',
        ]
    ],
];
  1. 示例控制台配置
return [
    'modules' => [
        'system' => [
            'class' => 'exoo\system\Module',
            'controllerNamespace' => 'exoo\system\controllers\console',
        ]
    ],
];
  1. 运行迁移
yii migrate --migrationPath=@yii/log/migrations/
yii migrate --migrationPath=@yii/rbac/migrations
yii migrate --migrationPath=@exoo/system/migrations
  1. 初始化rbac

    yii system/rbac/init
    
  2. 超级管理员角色分配

    yii system/user/assign-role admin 1