by Robin at 20241217

This commit is contained in:
Robin 2024-12-17 16:37:59 +08:00
parent b866791055
commit 8ca149f002
1 changed files with 2 additions and 8 deletions

View File

@ -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 {