mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2026-04-26 18:49:46 +08:00
优化鉴权
This commit is contained in:
@@ -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{}
|
||||
|
||||
Reference in New Issue
Block a user