mirror of
https://github.com/woodchen-ink/random-api-go.git
synced 2025-07-19 06:12:01 +08:00
修复当a端点引用b端点, a端点的url替换规则不生效的问题
This commit is contained in:
parent
d7c60d578c
commit
1949c8e9f3
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user