diff --git a/api/controller/apigateway/api_gateway_route.go b/api/controller/apigateway/api_gateway_route.go index 64caf443d..e769e81ea 100644 --- a/api/controller/apigateway/api_gateway_route.go +++ b/api/controller/apigateway/api_gateway_route.go @@ -560,6 +560,11 @@ func removeLeadingDigits(name string) string { return "" } + // 如果最后一个部分是 "s",直接返回整个字符串 + if parts[len(parts)-1] == "s" { + return name + } + // 移除最后一个部分并重新拼接 return strings.Join(parts[:len(parts)-1], "-") }