Browse Source

接口权限验证

路佳明 3 months ago
parent
commit
9ab391de0e
1 changed files with 4 additions and 6 deletions
  1. 4 6
      app/observe/router/ws_router.go

+ 4 - 6
app/observe/router/ws_router.go

@@ -2,21 +2,19 @@ package router
 
 import (
 	"go-admin/app/observe/apis"
-	"go-admin/common/middleware"
 	"go-admin/common/ws"
 
 	"github.com/gin-gonic/gin"
-	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
 )
 
 func init() {
-	routerCheckRole = append(routerCheckRole, wsNoCheckRouter)
-	// routerNoCheckRole = append(routerNoCheckRole, wsNoCheckRouter)
+	// routerCheckRole = append(routerCheckRole, wsNoCheckRouter)
+	routerNoCheckRole = append(routerNoCheckRole, wsNoCheckRouter)
 }
 
-func wsNoCheckRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
+func wsNoCheckRouter(v1 *gin.RouterGroup) {
 	api := apis.Service{}
-	r := v1.Group("/ws").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
+	r := v1.Group("/ws")
 	{
 		r.GET("/runtime/:channel", ws.WebsocketManager.WSClient)
 		// r.GET("/topology/services/ws", ws.WebsocketManager.ServiceTopoGraphWSClient) //service topo