更新细节
This commit is contained in:
parent
ea93a4d57b
commit
2e9f0d17dd
|
@ -93,7 +93,11 @@ class LoginLogic extends BaseLogic
|
|||
{
|
||||
try {
|
||||
$where = ['phone' => $params['account']];
|
||||
$user = User::field(['id', 'phone', 'avatar', 'nickname'])->where($where)->findOrEmpty();
|
||||
$user = User::field(['id', 'phone', 'avatar', 'nickname', 'need_reset'])->where($where)->findOrEmpty();
|
||||
if ($user->need_reset == 1) {
|
||||
self::setError('系统已升级,请重置密码');
|
||||
return false;
|
||||
}
|
||||
//更新登录信息
|
||||
$user->last_login_time = time();
|
||||
$user->last_login_ip = request()->ip();
|
||||
|
|
|
@ -31,6 +31,7 @@ class UserLogic extends BaseLogic
|
|||
$password = create_password($params['password'], $passwordSalt);
|
||||
// 更新
|
||||
$user->password = $password;
|
||||
$user->need_reset = 0;
|
||||
$user->save();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
|
Loading…
Reference in New Issue