数组到字符串转换$ log user,yii2

时间:2017-12-14 06:01:56

标签: arrays yii2

我要在yii2上实现RBAC并且已经为用户添加了角色和权限,但是当登录时我遇到了这个错误

  

数组到字符串转换

 * @return bool whether the user is logged in
 */
public function login(IdentityInterface $identity, $duration = 0)
{
    if ($this->beforeLogin($identity, false, $duration)) {
        $this->switchIdentity($identity, $duration);
        $id = $identity->getId();
        $ip = Yii::$app->getRequest()->getUserIP();
        if ($this->enableSession) {
 $log = "User '$id' logged in from $ip with duration $duration.";
        } else {
            $log = "User '$id' logged in from $ip. Session not enabled.";
        }
        Yii::info($log, __METHOD__);
        $this->afterLogin($identity, false, $duration);
    }

    return !$this->getIsGuest();
}

请提前帮我解决这个问题

0 个答案:

没有答案