From 3ac2d3319c8106c4ffad9155975802820c13b803 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 30 Aug 2024 16:42:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(X-Pack):=20apisix=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=B7=AF=E5=BE=84=E5=90=8E=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E4=BC=9A=E8=A2=AB=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- .../main/java/io/dataease/utils/WhitelistUtils.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index 7e46266484..1c6bacf00a 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 7e46266484070b6c2e2825668a884089fa5b3ec2 +Subproject commit 1c6bacf00aaa84ec09d4a0cceab08bba46a3b533 diff --git a/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java b/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java index d365c9e0fa..0f5ae6b230 100644 --- a/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java +++ b/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java @@ -73,4 +73,15 @@ public class WhitelistUtils { || StringUtils.startsWithAny(requestURI, "/communicate/image/") || StringUtils.startsWithAny(requestURI, "/communicate/down/"); } + + public static String getBaseApiUrl(String redirect_uri) { + if (StringUtils.endsWith(redirect_uri, "/")) { + redirect_uri = redirect_uri.substring(0, redirect_uri.length() - 1); + } + String contextPath = WhitelistUtils.getContextPath(); + if (StringUtils.isNotBlank(contextPath)) { + redirect_uri += contextPath; + } + return redirect_uri + AuthConstant.DE_API_PREFIX + "/"; + } }