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) } }