controller->getIdentityInfo(); if(defined('IN_WAP')&&IN_WAP==TRUE) { $loginUrl = \app\common\components\SiteUrl::loginhome(); } else { $loginUrl = \app\common\components\SiteUrl::login(); } if(!empty($identityInfo)&&is_array($identityInfo)) { if(sys_auth($identityInfo['cookieHash'],'DECODE')!=$identityInfo['user_name']) { Yii::$app->controller->showMessage(array('class'=>'warning','message'=>'您还没有登录,请先登录!','url'=>$loginUrl,'time'=>0)); return false; } } else { Yii::$app->controller->showMessage(array('class'=>'warning','message'=>'您还没有登录,请先登录!','url'=>$loginUrl,'time'=>0)); return false; } return true; } }