优化鉴权

This commit is contained in:
xh
2025-09-19 03:33:02 +08:00
parent 1c1d27681e
commit 5bc7d9dffd
20 changed files with 182 additions and 261 deletions
@@ -21,9 +21,10 @@ func DictDataRoute(rg *gin.RouterGroup) {
// authSrv := NewSettingDictDataService(db)
handle := dictDataHandler{}
notAuth := rg.Group("/setting", middleware.LoginAuth())
notAuth.GET("/dict/data/all", handle.All)
rg = rg.Group("/setting", middleware.TokenAuth())
rg.GET("/dict/data/all", handle.All)
rg.GET("/dict/data/detail", handle.Detail)
rg.POST("/dict/data/add", handle.Add)
rg.POST("/dict/data/edit", handle.Edit)
@@ -21,14 +21,15 @@ func DictTypeRoute(rg *gin.RouterGroup) {
// server := NewSettingDictTypeService(db)
handle := dictTypeHandler{}
notAuth := rg.Group("/setting", middleware.LoginAuth())
notAuth.GET("/dict/type/all", handle.All)
rg = rg.Group("/setting", middleware.TokenAuth())
rg.GET("/dict/type/all", handle.All)
rg.GET("/dict/type/list", handle.List)
rg.GET("/dict/type/detail", handle.Detail)
rg.POST("/dict/type/add", handle.Add)
rg.POST("/dict/type/edit", handle.Edit)
rg.POST("/dict/type/del", handle.Del)
auth := rg.Group("/setting", middleware.TokenAuth())
auth.GET("/dict/type/list", handle.List)
auth.GET("/dict/type/detail", handle.Detail)
auth.POST("/dict/type/add", handle.Add)
auth.POST("/dict/type/edit", handle.Edit)
auth.POST("/dict/type/del", handle.Del)
}
type dictTypeHandler struct{}