更新手机后更新token的缓存
This commit is contained in:
@@ -424,6 +424,11 @@ func (c *Auth2Controller) UpdateUserByMiniInfo() {
|
||||
if mobileAuth, err2 := auth2.LoginInternal(params.Ctx.Context, auth2.AuthTypeMobile, userInfo.PurePhoneNumber, auth2.UserIDMobile, auth2.InternalAuthSecret); err2 == nil {
|
||||
err = jsonerr.New(mobileAuth, model.ErrCodeJsonUserAlreadyExist)
|
||||
}
|
||||
} else if err == nil && userInfo.PurePhoneNumber != "" {
|
||||
if tokenInfo, err := auth2.GetTokenInfo(params.Token); err == nil {
|
||||
tokenInfo.Mobile = userInfo.PurePhoneNumber
|
||||
auth2.SetUserInfo(params.Token, tokenInfo, auth2.DefTokenDuration)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user