From c14ca0d8316db7aa57f871dcfb2566805306bf62 Mon Sep 17 00:00:00 2001 From: lanyulei Date: Mon, 18 Nov 2024 22:37:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=AA=8C=E8=AF=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 1 + go.sum | 1 - handler/auth.go | 4 ++++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 104d64ca..bd827269 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/gin-gonic/gin v1.9.1 github.com/go-kit/kit v0.13.0 github.com/go-ldap/ldap/v3 v3.4.6 + github.com/go-redis/redis v6.15.9+incompatible github.com/go-sql-driver/mysql v1.7.1 github.com/golang-jwt/jwt v3.2.2+incompatible github.com/google/uuid v1.4.0 diff --git a/go.sum b/go.sum index 22ec4b52..24878ecd 100644 --- a/go.sum +++ b/go.sum @@ -510,7 +510,6 @@ golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjs golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190501045829-6d32002ffd75/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.1.0 h1:r8Oj8ZA2Xy12/b5KZYj3tuv7NG/fBz3TwQVvpJ9l8Rk= golang.org/x/image v0.1.0/go.mod h1:iyPr49SD/G/TBxYVB/9RRtGUT5eNbo2u4NamWeQcD5c= diff --git a/handler/auth.go b/handler/auth.go index 7f2ac498..e50ddc18 100644 --- a/handler/auth.go +++ b/handler/auth.go @@ -93,6 +93,10 @@ func Authenticator(c *gin.Context) (interface{}, error) { } loginLog.Username = loginVal.Username + if loginVal.LoginType > 1 { + return nil, errors.New("unsupported login type") + } + // 查询设置 is_verify_code isVerifyCode, err = settings.GetContentByKey(1, "is_verify_code") if err != nil {