Merge branch 'master' into test

test
wj 2 years ago
commit 631e9004ab

@ -67,17 +67,15 @@ public class SyncController {
*/ */
@GetMapping("/udispsync/sync/testConnection") @GetMapping("/udispsync/sync/testConnection")
public BaseResponse testConnection(HttpServletRequest request) { public BaseResponse testConnection(HttpServletRequest request) {
String uri = uriUtils.parseUri(request.getRequestURL().toString());
String upperServerHost = systemParamConfigService.selectValueByParamKey("upper_server_ip"); String upperServerHost = systemParamConfigService.selectValueByParamKey("upper_server_ip");
if (StrUtil.isNotEmpty(upperServerHost)) { if (StrUtil.isNotEmpty(upperServerHost)) {
uri = upperServerHost + "/" + uri; upperServerHost = upperServerHost + "/udispsync/sync/testConnection";
} else { } else {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), request.getLocalAddr() + "服务缺少上级服务IP"); return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), request.getLocalAddr() + "服务缺少上级服务IP");
} }
uri = changeUri(uri);
JSONObject jsonObject = null; JSONObject jsonObject = null;
try { try {
jsonObject = redirect(request, uri); jsonObject = redirect(request, upperServerHost);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), request.getLocalAddr() + "服务访问上级服务" + upperServerHost + "异常"); return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), request.getLocalAddr() + "服务访问上级服务" + upperServerHost + "异常");

Loading…
Cancel
Save