1、认证
1.1 用户组件
2、前后台分离
2.6
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backendcontrollers',
'bootstrap' => ['log'],
'language' => 'zh-CN',
'modules' => [],
'components' => [
'user' => [
'identityClass' => 'commonmodelsAdminuser',
'enableAutoLogin' => true,
],
/*adminsession*/
'session' => [
'name' => 'PHPBACKSESSION',
'savePath' => sys_get_temp_dir(),
],
'request'=>[
'cookieValidationKey' => 'fdlkfjl;fklsfjkldfdk',
'csrfParam' => '_adminCSRF',
],
/*adminsession*/
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yiilogFileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
/*
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
*/
],
'params' => $params,
];