In the YII2 How to configure the front and rear platform, so that in a project can also log in and before and after the platform.
I am now in the config/web.php configuration is this has the configuration foreground:
' User ' = [
' Identityclass ' = ' app\models\frontuser ',
' Enableautologin ' = true,
' Loginurl ' =>[' manager/login '],//define background default login interface [insufficient permissions to jump to this page]
' Identitycookie ' = [' name ' = ' __user_identity ', ' httponly ' = True],
' Idparam ' = ' __user '
],
Next I want how to configure can login backstage, ask the great God advice.
Reply content:
In the YII2 How to configure the front and rear platform, so that in a project can also log in and before and after the platform.
I am now in the config/web.php configuration is this has the configuration foreground:
' User ' = [
' Identityclass ' = ' app\models\frontuser ',
' Enableautologin ' = true,
' Loginurl ' =>[' manager/login '],//define background default login interface [insufficient permissions to jump to this page]
' Identitycookie ' = [' name ' = ' __user_identity ', ' httponly ' = True],
' Idparam ' = ' __user '
],
Next I want how to configure can login backstage, ask the great God advice.
Front desk
'user' => [ 'identityClass' => 'app\models\FrontUser', 'enableAutoLogin' => true, 'loginUrl'=>['manager/login'],//定义后台默认登录界面[权限不足跳到该页] //'identityCookie' => ['name' => '__user_identity', 'httpOnly' => true], 'idParam' => '__user'],
Background
'admin' => [ 'class' => 'yii\web\User', 'identityClass' => 'app\models\AdminUser', 'enableAutoLogin' => true, 'loginUrl'=>['manager/login'],//定义后台默认登录界面[权限不足跳到该页] //'identityCookie' => ['name' => '__user_identity', 'httpOnly' => true], 'idParam' => '__admin'],