From 6a93d22890ca92fce02b11eaf2fb910838967700 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 26 七月 2023 10:18:22 +0800 Subject: [PATCH] 资源类添加args字段 --- src/main/java/com/moon/server/service/sys/ProxyService.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/moon/server/service/sys/ProxyService.java b/src/main/java/com/moon/server/service/sys/ProxyService.java index fdaccde..f956b77 100644 --- a/src/main/java/com/moon/server/service/sys/ProxyService.java +++ b/src/main/java/com/moon/server/service/sys/ProxyService.java @@ -63,10 +63,7 @@ insertLog(req, ue, resId); - String url = getSourceUrl(req, entity, token); - if (isRest) { - url = url.replace("/wmts/layer/", "/rest/layer/"); - } + String url = getSourceUrl(req, entity, token, isRest); res.setHeader("token", token); forward(req, res, entity, url); } @@ -239,11 +236,14 @@ /** * 鑾峰彇鍘熷Url */ - private String getSourceUrl(HttpServletRequest req, ResEntity entity, String token) { + private String getSourceUrl(HttpServletRequest req, ResEntity entity, String token, boolean isRest) { String proxyUrl = entity.getProxy().replace("{token}", token); int end = req.getRequestURL().indexOf(proxyUrl) + proxyUrl.length(); String url = entity.getUrl() + req.getRequestURL().substring(end); + if (isRest) { + url = url.replace("/wmts/layer/", "/rest/layer/"); + } if (null != req.getQueryString()) { url = url + (entity.getUrl().contains("?") ? "&" : "?") + req.getQueryString(); } -- Gitblit v1.9.3