by Robin at 20241217 #915
|
@ -846,20 +846,14 @@ func (s *Service) OpResetMobilePhone(ctx *gin.Context, req *loginproto.OpResetMo
|
|||
return
|
||||
}
|
||||
|
||||
// 2.计算AES和phoneHash
|
||||
aesStr, err := mycrypto.CryptoServiceInstance().AES.Encrypt([]byte(req.NewMobilePhone))
|
||||
if err != nil {
|
||||
logger.Error("AES Encrypt failed : %v", err)
|
||||
ec = errcode.ErrCodeEncryptionInterceptFail
|
||||
return
|
||||
}
|
||||
// 2.计算phoneHash
|
||||
phoneHash := mycrypto.CryptoServiceInstance().SHA256.Encrypt([]byte(req.NewMobilePhone))
|
||||
|
||||
// 3.更新account表
|
||||
if err := _DefaultAccount.OpUpdate(ctx, &accountproto.OpUpdateReq{
|
||||
Account: &dbstruct.Account{
|
||||
Mid: goproto.Int64(util.DerefInt64(login.Mid)),
|
||||
MobilePhone: goproto.String(string(aesStr)),
|
||||
MobilePhone: goproto.String(req.NewMobilePhone),
|
||||
PhoneHash: goproto.String(phoneHash),
|
||||
},
|
||||
}); err != nil {
|
||||
|
|
Loading…
Reference in New Issue