scope.go 635 B

1234567891011121314151617181920212223
  1. package router
  2. import (
  3. "go-admin/app/observe/apis"
  4. "go-admin/common/middleware"
  5. "github.com/gin-gonic/gin"
  6. jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
  7. )
  8. func init() {
  9. routerCheckRole = append(routerCheckRole, registerUrlScopeTopoRouter)
  10. // routerNoCheckRole = append(routerNoCheckRole, registerUrlScopeTopoRouter)
  11. }
  12. func registerUrlScopeTopoRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  13. api := apis.WeaveScope{}
  14. // r := v1.Group("/topology")
  15. r := v1.Group("/topology").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
  16. {
  17. r.GET("/:app_alias", api.GetMenu)
  18. }
  19. }