请问修改密码的时候会报超时错误,是什么原因呢? [ 2.0 版本 ]
大家好,我在对user的密码字段进行修改的时候,会报超时错误。
但是。。。但是。 很简单的修改密码。没有任何其他的操作,只是更新password字段。
错误触发行vendor/yiisoft/yii2/base/Security.php:565
还请朋友们解答。谢谢。
我的修改部分代码
/** @return User */
public function getUser()
{
    if ($this->_user == null) {
        $this->_user = \Yii::$app->user->identity;
    }
    return $this->_user;
}
/**
 * Saves new account settings.
 *
 * @return bool
 */
public function save()
{
    if ($this->validate()) {
        $this->user->email = $this->email;
        // 新密码没填写 则为不修改密码
        if ($this->new_password) {
            $this->user->password = $this->new_password;
        }
        return $this->user->save();
    }
    return false;
}
共 1 个回答
xjdata
            注册时间:2011-12-07
最后登录:2024-05-05
在线时长:112小时38分
    最后登录:2024-05-05
在线时长:112小时38分
- 粉丝23
 - 金钱14169
 - 威望75
 - 积分16039