调整权限

This commit is contained in:
xiangheng
2024-01-04 13:24:18 +08:00
parent 91366071cd
commit b94d1d76d2
26 changed files with 74 additions and 46 deletions

View File

@@ -39,7 +39,14 @@ func initRouter() *gin.Engine {
c.FileFromFS("static"+filepath, staticHttpFs)
})
router.GET("/api/admin/apiList", func(ctx *gin.Context) {
var path = []string{}
for _, route := range router.Routes() {
// fmt.Printf("%s 127.0.0.1:%v%s\n", route.Method, config.Config.ServerPort, route.Path)
path = append(path, route.Path)
}
response.Result(ctx, response.Success, path)
})
// 设置中间件
router.Use(gin.Logger(), middleware.Cors(), middleware.ErrorRecover())
// 演示模式
@@ -54,10 +61,6 @@ func initRouter() *gin.Engine {
routers.RegisterGroup(group)
for _, route := range router.Routes() {
fmt.Printf("%s %s\n", route.Method, route.Path)
}
return router
}