Skip to content

Commit

Permalink
fix: 优化登录类型验证。
Browse files Browse the repository at this point in the history
  • Loading branch information
lanyulei committed Nov 18, 2024
1 parent 0cf6726 commit c14ca0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
4 changes: 4 additions & 0 deletions handler/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c14ca0d

Please sign in to comment.