login feature

This commit is contained in:
Simon Ding
2024-07-12 10:06:26 +08:00
parent a172ca0361
commit 60c3c8822e
16 changed files with 751 additions and 16 deletions

View File

@@ -38,12 +38,17 @@ func (s *Server) Serve() error {
//st, _ := fs.Sub(ui.Web, "build/web")
s.r.Use(static.Serve("/", static.EmbedFolder(ui.Web, "build/web")))
s.r.POST("/api/login", HttpHandler(s.Login))
api := s.r.Group("/api/v1")
api.Use(s.authModdleware)
setting := api.Group("/setting")
{
setting.POST("/do", HttpHandler(s.SetSetting))
setting.GET("/do", HttpHandler(s.GetSetting))
setting.POST("/auth", HttpHandler(s.EnableAuth))
setting.GET("/auth", HttpHandler(s.GetAuthSetting))
}
tv := api.Group("/tv")