fix queryservice verifyCode mobile encrypte

This commit is contained in:
liangzai 2025-04-08 15:38:50 +08:00
parent fa9869ccf2
commit 95ab1296a8

View File

@ -1300,7 +1300,12 @@ func (l *QueryServiceLogic) VerifyCode(mobile string, code string) error {
if mobile == "17776203797" && code == "123456" {
return nil
}
codeRedisKey := fmt.Sprintf("%s:%s", "query", mobile)
secretKey := l.svcCtx.Config.Encrypt.SecretKey
encryptedMobile, err := crypto.EncryptMobile(mobile, secretKey)
if err != nil {
return errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "加密手机号失败: %+v", err)
}
codeRedisKey := fmt.Sprintf("%s:%s", "query", encryptedMobile)
cacheCode, err := l.svcCtx.Redis.Get(codeRedisKey)
if err != nil {
if errors.Is(err, redis.Nil) {