fix queryservice verifyCode mobile encrypte
This commit is contained in:
parent
fa9869ccf2
commit
95ab1296a8
@ -1300,7 +1300,12 @@ func (l *QueryServiceLogic) VerifyCode(mobile string, code string) error {
|
|||||||
if mobile == "17776203797" && code == "123456" {
|
if mobile == "17776203797" && code == "123456" {
|
||||||
return nil
|
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)
|
cacheCode, err := l.svcCtx.Redis.Get(codeRedisKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, redis.Nil) {
|
if errors.Is(err, redis.Nil) {
|
||||||
|
Loading…
Reference in New Issue
Block a user