2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

feat: 登录支持输入2fa验证码

This commit is contained in:
2025-05-14 19:16:06 +08:00
parent 13f090e2b7
commit fae5d136d4
5 changed files with 39 additions and 5 deletions

View File

@@ -29,7 +29,8 @@ func MustLogin(t *gotext.Locale, session *sessions.Manager) func(next http.Handl
"/api/user/key",
"/api/user/login",
"/api/user/logout",
"/api/user/isLogin",
"/api/user/is_login",
"/api/user/is_2fa",
"/api/dashboard/panel",
}
return func(next http.Handler) http.Handler {

View File

@@ -12,7 +12,7 @@ type UserLogin struct {
}
type UserIsTwoFA struct {
Username string `uri:"username" validate:"required"`
Username string `query:"username" validate:"required"`
}
type UserCreate struct {

View File

@@ -111,6 +111,7 @@ func (route *Http) Register(r *chi.Mux) {
r.With(middleware.Throttle(5, time.Minute)).Post("/login", route.user.Login)
r.Post("/logout", route.user.Logout)
r.Get("/is_login", route.user.IsLogin)
r.Get("/is_2fa", route.user.IsTwoFA)
r.Get("/info", route.user.Info)
})