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 {