From e43e76697b40cdb2f7404a1c6a8d3c14fec1ad3a Mon Sep 17 00:00:00 2001 From: liangzai <2440983361@qq.com> Date: Fri, 9 May 2025 19:44:54 +0800 Subject: [PATCH] fix --- app/main/api/desc/front/product.api | 1 + app/main/api/internal/handler/routes.go | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/main/api/desc/front/product.api b/app/main/api/desc/front/product.api index 0818d03..9565820 100644 --- a/app/main/api/desc/front/product.api +++ b/app/main/api/desc/front/product.api @@ -26,6 +26,7 @@ service main { @server ( prefix: api/v1/product group: product + middleware: SourceInterceptor ) service main { @handler GetProductRenderList diff --git a/app/main/api/internal/handler/routes.go b/app/main/api/internal/handler/routes.go index 0540091..047a764 100644 --- a/app/main/api/internal/handler/routes.go +++ b/app/main/api/internal/handler/routes.go @@ -304,13 +304,16 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { ) server.AddRoutes( - []rest.Route{ - { - Method: http.MethodGet, - Path: "/render_list/:module", - Handler: product.GetProductRenderListHandler(serverCtx), - }, - }, + rest.WithMiddlewares( + []rest.Middleware{serverCtx.SourceInterceptor}, + []rest.Route{ + { + Method: http.MethodGet, + Path: "/render_list/:module", + Handler: product.GetProductRenderListHandler(serverCtx), + }, + }..., + ), rest.WithPrefix("/api/v1/product"), )