How to configure the frontend and backend in yii2 so that you can log on to the frontend and backend at the same time in a project. I am now in configweb. php configuration is configured on the frontend: & #039; user & #039; & amp; gt; [& #039; identityClass & #039; & amp; gt; & #039; appmodelsFrontUser & #039;, & #039; enableAutoLogin & #039; & amp; gt; true, & #039 ;... how to configure the frontend and backend in yii2 so that you can log on to the frontend and backend at the same time in a project.
Currently, the configuration in config/web. php has the following foreground Configuration:
'User' => [
'Identityclass' => 'app \ models \ frontuser ',
'Enablesautologin' => true,
'Loginurl' => ['manager/login'], // defines the default logon interface in the background. [skip to this page if you have insufficient permissions]
// 'Identitycookie '=> ['name' =>' _ user_identity ', 'httponly' => true],
'Idparam' => '_ user'
],
Next, how can I configure it to log on to the background.
Reply content:
How to configure the frontend and backend in yii2 so that you can log on to the frontend and backend at the same time in a project.
Currently, the configuration in config/web. php has the following foreground Configuration:
'User' => [
'Identityclass' => 'app \ models \ frontuser ',
'Enablesautologin' => true,
'Loginurl' => ['manager/login'], // defines the default logon interface in the background. [skip to this page if you have insufficient permissions]
// 'Identitycookie '=> ['name' =>' _ user_identity ', 'httponly' => true],
'Idparam' => '_ user'
],
Next, how can I configure it to log on to the background.
Front-end
'User' => ['identityclass' => 'app \ models \ frontuser', 'enableautologin' => true, 'loginurl' => ['manager/login'], // define the default logon interface in the background [jump to this page with insufficient permissions] // 'identitycookies' => ['name' => '_ user_identity ', 'httpponly '=> true], 'idparam' =>' _ user'],
Background
'Admin' => ['class' => 'yii \ web \ user', 'identityclass' => 'app \ models \ adminuser', 'enablesautologin '=> true, 'loginurl' => ['manager/login'], // define the default logon interface in the background [jump to this page with insufficient permissions] // 'identitycookies' => ['name' => '_ user_identity ', 'httpponly '=> true], 'idparam' =>' _ admin'],