From d22935703d7fe5a5cf984c340854768f725fb4d8 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 22 Feb 2022 19:05:12 +0800 Subject: [PATCH] forget pwd --- internal/demo/register/verify.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/demo/register/verify.go b/internal/demo/register/verify.go index b362fd340..01fafbb92 100644 --- a/internal/demo/register/verify.go +++ b/internal/demo/register/verify.go @@ -45,9 +45,16 @@ func Verify(c *gin.Context) { log.NewInfo("0", " params.VerificationCode != config.Config.Demo.SuperCode", params.VerificationCode, config.Config.Demo) log.NewInfo(params.OperationID, "begin get form redis", account) if params.UsedFor == 0 { - params.UsedFor = 1 + params.UsedFor = constant.VerificationCodeForRegister } - accountKey := account + "_" + constant.VerificationCodeForRegisterSuffix + var accountKey string + switch params.UsedFor { + case constant.VerificationCodeForRegister: + accountKey = account + "_" + constant.VerificationCodeForRegisterSuffix + case constant.VerificationCodeForReset: + accountKey = account + "_" + constant.VerificationCodeForResetSuffix + } + code, err := db.DB.GetAccountCode(accountKey) log.NewInfo(params.OperationID, "redis phone number and verificating Code", accountKey, code, params) if err != nil {