From 7823306045c585601fe9d7319c3ddfb1cd67e114 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Thu, 30 Jun 2022 19:11:44 +0800 Subject: [PATCH] demo --- internal/demo/register/send_code.go | 2 +- internal/demo/register/set_password.go | 2 +- internal/demo/register/verify.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/demo/register/send_code.go b/internal/demo/register/send_code.go index b895141ba..d229a6bae 100644 --- a/internal/demo/register/send_code.go +++ b/internal/demo/register/send_code.go @@ -110,7 +110,7 @@ func SendVerificationCode(c *gin.Context) { // TemplateCode: tea.String(config.Config.Demo.AliSMSVerify.VerificationCodeTemplateCode), // TemplateParam: tea.String(fmt.Sprintf("{\"code\":\"%d\"}", code)), //} - response, err := sms.SendSms(code, accountKey) + response, err := sms.SendSms(code, params.AreaCode+params.PhoneNumber) //response, err := client.SendSms(sendSmsRequest) if err != nil { log.NewError(params.OperationID, "sendSms error", account, "err", err.Error(), response) diff --git a/internal/demo/register/set_password.go b/internal/demo/register/set_password.go index 45538bcaf..c2498e653 100644 --- a/internal/demo/register/set_password.go +++ b/internal/demo/register/set_password.go @@ -47,7 +47,7 @@ func SetPassword(c *gin.Context) { params.Nickname = account } if params.VerificationCode != config.Config.Demo.SuperCode { - accountKey := account + "_" + constant.VerificationCodeForRegisterSuffix + accountKey := params.AreaCode + account + "_" + constant.VerificationCodeForRegisterSuffix v, err := db.DB.GetAccountCode(accountKey) if err != nil || v != params.VerificationCode { log.NewError(params.OperationID, "password Verification code error", account, params.VerificationCode) diff --git a/internal/demo/register/verify.go b/internal/demo/register/verify.go index 6fae4a84f..5e8ecdffc 100644 --- a/internal/demo/register/verify.go +++ b/internal/demo/register/verify.go @@ -51,9 +51,9 @@ func Verify(c *gin.Context) { var accountKey string switch params.UsedFor { case constant.VerificationCodeForRegister: - accountKey = account + "_" + constant.VerificationCodeForRegisterSuffix + accountKey = params.AreaCode + account + "_" + constant.VerificationCodeForRegisterSuffix case constant.VerificationCodeForReset: - accountKey = account + "_" + constant.VerificationCodeForResetSuffix + accountKey = params.AreaCode + account + "_" + constant.VerificationCodeForResetSuffix } code, err := db.DB.GetAccountCode(accountKey)