2018-11-24 18:24:31 1575次浏览 2条回答 0 悬赏 65 金钱

在模板里面退出登录后必须要调用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;
} 
您需要登录后才可以回答。登录 | 立即注册
一粒坏汤屎
试用期

一粒坏汤屎

注册时间:2018-10-24
最后登录:2019-01-25
在线时长:2小时37分
  • 粉丝0
  • 金钱5
  • 威望0
  • 积分25

热门问题