This commit is contained in:
skiffer-git
2022-07-01 17:23:43 +08:00
parent ed52ecb259
commit 5c4982a3f1
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -75,13 +75,19 @@ func SendVerificationCode(c *gin.Context) {
accountKey = accountKey + "_" + constant.VerificationCodeForRegisterSuffix
ok, err := db.DB.JudgeAccountEXISTS(accountKey)
if ok || err != nil {
log.NewError(params.OperationID, "Repeat send code", params)
log.NewError(params.OperationID, "Repeat send code", params, accountKey)
c.JSON(http.StatusOK, gin.H{"errCode": constant.RepeatSendCode, "errMsg": "Repeat send code"})
return
}
case constant.VerificationCodeForReset:
accountKey = accountKey + "_" + constant.VerificationCodeForResetSuffix
ok, err := db.DB.JudgeAccountEXISTS(accountKey)
if ok || err != nil {
log.NewError(params.OperationID, "Repeat send code", params, accountKey)
c.JSON(http.StatusOK, gin.H{"errCode": constant.RepeatSendCode, "errMsg": "Repeat send code"})
return
}
}
rand.Seed(time.Now().UnixNano())
code := 100000 + rand.Intn(900000)