How to configure the front and rear stations in the YII2, making it possible to log in and out of a project

Source: Internet
Author: User
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'],
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.