更改代码结构

This commit is contained in:
xmdhs 2023-10-08 15:50:36 +08:00
parent 04a6cc96c1
commit 6493edce01
No known key found for this signature in database
GPG Key ID: E809D6D43DEFCC95

View File

@ -75,11 +75,13 @@ func newSkinApi(handel *handle.Handel) http.Handler {
r.Post("/user/password", handel.ChangePasswd()) r.Post("/user/password", handel.ChangePasswd())
r.Post("/user/name", handel.ChangeName()) r.Post("/user/name", handel.ChangeName())
})
r.Group(func(r chi.Router) { r.Group(func(r chi.Router) {
r.Use(handel.NeedAuth)
r.Use(handel.NeedAdmin) r.Use(handel.NeedAdmin)
r.Get("/admin/users", handel.ListUser()) r.Get("/admin/users", handel.ListUser())
}) })
})
return r return r
} }