配置后台默认路由报 302重定向错误? [ 2.0 版本 ]
The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
'defaultRoute' => 'admin/login', //配置默认路由
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack();
} else {
return $this->renderPartial('login', [
'model' => $model,
]);
}
}
设置默认为管理员登录页面, 奇怪了换成别的路由却能用? 求解释
tw1996 补充于 2017-03-04 23:56
我好像找到原因了, 是我之前登录状态没有 logout() 注销, 所以直接 return $this->goHome(); 可是为啥不进入正确的页面反而报错呢 ? 疑惑
共 1 个回答
tw1996
注册时间:2016-03-13
最后登录:2020-03-25
在线时长:37小时2分
最后登录:2020-03-25
在线时长:37小时2分
- 粉丝3
- 金钱0
- 威望0
- 积分370