简体   繁体   English

CakePHP 3.x管理员部分

[英]CakePHP 3.x Admin Section

I'm migrating to CakePHP 3.x, the new version of CakePHP and faced some issued while implementing admin section, like not able to separate user and admin login. 我正在迁移到CakePHP的新版本CakePHP 3.x,并在实现admin部分时遇到了一些问题,例如无法分离用户和管理员登录名。

A had also added following code into app/Config/routes.php file: A还已将以下代码添加到app / Config / routes.php文件中:

Router::prefix('admin', function ($routes) {
    // All routes here will be prefixed with `/admin`
    // And have the prefix => admin route element added.
    $routes->fallbacks('DashedRoute');
});

When I logout from user section, admin also logout. 当我从用户部分注销时,管理员也会注销。 What I want is, on same browser able to login into user and admin account and able to manage both session separately. 我想要的是,在同一浏览器上能够登录用户和管理员帐户,并能够分别管理两个会话。 Admin keep it's sign up, even if user logout from it's account. 管理员保留它的注册状态,即使用户从其帐户中注销也是如此。

I had also checked many blogs, but still not working. 我也检查了许多博客,但仍然无法正常工作。

If working example is available, that would be appreciated. 如果有可用的工作示例,将不胜感激。

您必须在Auth配置中更改Cookie名称(例如在Admin AppController中为示例)

检查以下内容: https : //groups.google.com/forum/#!topic/cake-php/zKrxSUQLi6s您需要创建一个文件夹Admin,并将带有admin的名称空间放入控制器中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM