From 71419171c8dbdeddae666a8d45d761ac4d0c5a86 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Thu, 15 Jul 2021 13:56:00 +0800 Subject: [PATCH] aa --- business/auth2/auth2.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/business/auth2/auth2.go b/business/auth2/auth2.go index d25a1d825..02c8dfb9f 100644 --- a/business/auth2/auth2.go +++ b/business/auth2/auth2.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/base64" "errors" + "fmt" "regexp" "strings" "time" @@ -212,6 +213,9 @@ func SendVerifyCode(authToken, captchaID, captchaValue, authID string) (verfifyC if handler := authers[authType]; handler == nil { err = ErrIllegalAuthType } else { + if user, _ := dao.GetUserByID(dao.GetDB(), "mobile", authID); user != nil { + return "", authInfo, fmt.Errorf("该用户已存在,请勿重复注册!") + } verfifyCode, err = handler.SendVerifyCode(authID) } }