|
|
@ -79,7 +79,7 @@ public class ServiceRouteInfoBuilder { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected String buildServletPath(ServiceApiInfo serviceApiInfo, ServiceApiInfo.ApiMeta apiMeta) { |
|
|
|
protected String buildServletPath(ServiceApiInfo serviceApiInfo, ServiceApiInfo.ApiMeta apiMeta) { |
|
|
|
String contextPath = environment.getProperty("server.servlet.context-path", getContextPathForOld()); |
|
|
|
String contextPath = getContextPathCompatibility(); |
|
|
|
String servletPath = apiMeta.getPath(); |
|
|
|
String servletPath = apiMeta.getPath(); |
|
|
|
if (servletPath == null) { |
|
|
|
if (servletPath == null) { |
|
|
|
servletPath = ""; |
|
|
|
servletPath = ""; |
|
|
@ -95,11 +95,13 @@ public class ServiceRouteInfoBuilder { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 兼容老版本获取context-path |
|
|
|
* 获取context-path,兼容老版本 |
|
|
|
* @return 返回context-path,没有返回/ |
|
|
|
* @return 返回context-path,没有返回"/" |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String getContextPathForOld() { |
|
|
|
private String getContextPathCompatibility() { |
|
|
|
return environment.getProperty("server.context-path", DEFAULT_CONTEXT_PATH); |
|
|
|
return environment.getProperty("server.servlet.context-path", |
|
|
|
|
|
|
|
environment.getProperty("server.context-path", DEFAULT_CONTEXT_PATH) |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void checkPath(String path, String errorMsg) { |
|
|
|
private void checkPath(String path, String errorMsg) { |
|
|
|