代码拉取完成,页面将自动刷新
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 版本所有',
];
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。