在 modules 里面退出登录不成功 [ 2.0 版本 ]
在模板里面退出登录后必须要调用gohome方法,才能退出成功。如果退出登录跳转到我指定的方法里,isGuest会为false。
/**
* Logs out the current user.
* 退出登录
* @return mixed
*/
public function actionLogout()
{
Yii::$app->user->logout();
return $this->goHome();
$host = \Yii::$app->request->getHostInfo();
header('Location:'.$host.'/wap/login/index');exit;
}
共 2 个回答
-
-
zone_g@163.com 回答于 2019-03-16 11:06 举报
当前module中的user组件和应用的user组件是否一致
理论上执行了loginout就会清楚身份信息的
一粒坏汤屎
注册时间:2018-10-24
最后登录:2019-01-25
在线时长:2小时37分
最后登录:2019-01-25
在线时长:2小时37分
- 粉丝0
- 金钱5
- 威望0
- 积分25