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

View File

@ -705,7 +705,7 @@ demo:
enable: true enable: true
superCode: 666666 #超级验证码,建议修改掉,收不到短信验证码时可以用此替代 superCode: 666666 #超级验证码,建议修改掉,收不到短信验证码时可以用此替代
# second # second
codeTTL: 300 codeTTL: 60
mail: #仅支持qq邮箱具体操作参考 https://service.mail.qq.com/cgi-bin/help?subtype=1&id=28&no=1001256 必须修改 mail: #仅支持qq邮箱具体操作参考 https://service.mail.qq.com/cgi-bin/help?subtype=1&id=28&no=1001256 必须修改
title: "openIM" title: "openIM"
senderMail: "765567899@qq.com" senderMail: "765567899@qq.com"

View File

@ -75,13 +75,19 @@ func SendVerificationCode(c *gin.Context) {
accountKey = accountKey + "_" + constant.VerificationCodeForRegisterSuffix accountKey = accountKey + "_" + constant.VerificationCodeForRegisterSuffix
ok, err := db.DB.JudgeAccountEXISTS(accountKey) ok, err := db.DB.JudgeAccountEXISTS(accountKey)
if ok || err != nil { 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"}) c.JSON(http.StatusOK, gin.H{"errCode": constant.RepeatSendCode, "errMsg": "Repeat send code"})
return return
} }
case constant.VerificationCodeForReset: case constant.VerificationCodeForReset:
accountKey = accountKey + "_" + constant.VerificationCodeForResetSuffix 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()) rand.Seed(time.Now().UnixNano())
code := 100000 + rand.Intn(900000) code := 100000 + rand.Intn(900000)