add: user accomplished
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"juwan-backend/common/redisx"
|
||||
"time"
|
||||
|
||||
"juwan-backend/app/email/api/internal/svc"
|
||||
@@ -44,7 +45,7 @@ func (l *SendVerificationCodeLogic) SendVerificationCode(req *types.SendVerifica
|
||||
code := utils.GenCode()
|
||||
requestID := uuid.NewString()
|
||||
|
||||
redisKey := fmt.Sprintf("vcode:%s:%s:%s", requestID, req.Scene, req.Email)
|
||||
redisKey := fmt.Sprintf(redisx.VCODE_KEY_PREFIX, requestID, req.Scene, req.Email)
|
||||
if exists, getErr := l.svcCtx.RedisCluster.Get(l.ctx, redisKey).Result(); getErr == nil && exists != "" {
|
||||
return nil, fmt.Errorf("verification code already sent, please wait before requesting a new one")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user