Yii实现无密码自动登录

Yii实现无密码自动登录
在UserIdentity中添加如下方法 PHP public static function createAuthenticatedIdentity($user) { $identity=new self($user->id,''); $identity->_name = $user->username; $identity->_id = $user->id; $identity->setState('userInfo', $user); $identity->errorCode=self::ERROR_NONE; return $identity; } ...