1 Star 0 Fork 0

/yii-ace

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

安装

composer require xing/yii-ace

配置

Once the extension is installed, simply modify your application configuration as follows:

return [
    'modules' => [
        'admin' => [
            'class' => 'xing\ace\Module',
            
            // Make use of that kind of user
            'user' => 'admin',
            
            // Do not verify permissions
            'verifyAuthority' => false,
            ...
        ]
        ...
    ],
    ...
    'components' => [
        // Front desk user
        'user' => [
            'identityClass'   => 'app\models\User',
            'enableAutoLogin' => true,
        ],
        
        // Background user
        'admin' => [
            'class' => '\yii\web\User',
            'identityClass' => 'xing\ace\models\Admin',
            'enableAutoLogin' => true,
            'loginUrl' => ['/admin/default/login'],
            'idParam' => '_adminId',
            'identityCookie' => ['name' => '_admin','httpOnly' => true],
        ],
        
        // This step is not necessary, but you use it outside the module. The controller, view in the module must be added!
        'i18n' => [
            'translations' => [
                'admin' => [
                    'class'          => 'yii\i18n\PhpMessageSource',
                    'sourceLanguage' => 'en',
                    'basePath'       => '@xing/ace/messages'
                ],
            ],
        ],
                
    ]
];

There are also some param configuration, not mandatory, with default values

// Need to configure params.php
return [
    // Background prefix, used to import data, the prefix of the permission name; currently there is no good solution, all use this configuration item
    'admin_rule_prefix' => 'admin', 
    
     // Login navigation menu cache time
    'cacheTime'         => 86400,    
    
    // Universal status                       
    'status'            => ['停用', '启用'],
    
    // Show other information
    'project_open_other' => false,
               
    'projectName'       => '后台管理系统',              
    'projectTitle'      => '后台管理系统',
    'companyName'       => 'xxx 版本所有',  
];

About the configuration of permissions

return [
    'components' => [
        'modules' => [
            'admin' => [
                'class' => 'xing\ace\Module',
                
                // Make use of that kind of user
                'user' => 'admin'
                ...
            ]
            ...
        ],
        // authority management
        'authManager'  => [
            'class' => 'yii\rbac\DbManager',
        ],
        ...
    ],
]

打开命令行执行下面的命令导入数据

php yii migrate --migrationPath=@xing/yii-ace/migrations

默认用户名: admin 密码: chenxing

// Login address
http://localhost/path/to?index.php?r=admin/default/login

空文件

简介

暂无描述 展开 收起
取消

发行版 (3)

全部
2年前

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/aa0605/yii-ace.git
git@gitee.com:aa0605/yii-ace.git
aa0605
yii-ace
yii-ace
master

搜索帮助