diff --git a/internal/api/route.go b/internal/api/route.go index 0e3b15baa..925679a92 100644 --- a/internal/api/route.go +++ b/internal/api/route.go @@ -7,6 +7,8 @@ import ( "OpenIM/pkg/common/prome" "OpenIM/pkg/discoveryregistry" "github.com/gin-gonic/gin" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "io" "os" ) @@ -26,7 +28,7 @@ func NewGinRouter(zk discoveryregistry.SvcDiscoveryRegistry) *gin.Engine { r.Use(prome.PrometheusMiddleware) r.GET("/metrics", prome.PrometheusHandler()) } - zk.AddOption(mw.GrpcClient()) // 默认RPC中间件 + zk.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials())) // 默认RPC中间件 userRouterGroup := r.Group("/user") { u := NewUser(zk)