From 1949c8e9f3277a7af1c0daa0e3f2abba71db4a89 Mon Sep 17 00:00:00 2001 From: wood chen Date: Mon, 16 Jun 2025 09:28:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93a=E7=AB=AF=E7=82=B9?= =?UTF-8?q?=E5=BC=95=E7=94=A8b=E7=AB=AF=E7=82=B9,=20a=E7=AB=AF=E7=82=B9?= =?UTF-8?q?=E7=9A=84url=E6=9B=BF=E6=8D=A2=E8=A7=84=E5=88=99=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/endpoint_service.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/service/endpoint_service.go b/service/endpoint_service.go index 54ceb53..2c0ce4d 100644 --- a/service/endpoint_service.go +++ b/service/endpoint_service.go @@ -228,7 +228,13 @@ func (s *EndpointService) getRandomURLRealtime(endpoint *model.APIEndpoint) (str } // 递归调用获取目标端点的随机URL - return s.GetRandomURL(targetEndpoint.URL) + targetURL, err := s.GetRandomURL(targetEndpoint.URL) + if err != nil { + return "", err + } + + // 对从目标端点获取的URL应用当前端点的替换规则 + return s.applyURLReplaceRules(targetURL, endpoint.URL), nil } return s.applyURLReplaceRules(randomURL, endpoint.URL), nil @@ -280,7 +286,13 @@ func (s *EndpointService) getRandomURLWithCache(endpoint *model.APIEndpoint) (st } // 递归调用获取目标端点的随机URL - return s.GetRandomURL(targetEndpoint.URL) + targetURL, err := s.GetRandomURL(targetEndpoint.URL) + if err != nil { + return "", err + } + + // 对从目标端点获取的URL应用当前端点的替换规则 + return s.applyURLReplaceRules(targetURL, endpoint.URL), nil } return s.applyURLReplaceRules(randomURL, endpoint.URL), nil