From 50740e17b4ccdb948011c465cb68556b3606123f Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 3 Nov 2021 16:23:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E7=A6=85=E9=81=93GET=E8=AF=B7=E6=B1=82=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E7=9A=84=E6=9B=B4=E6=96=B0=E5=92=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1007605 --user=lyh 【github#7231】lts版本,集成禅道模块未放开请求方式功能,导致默认GET请求的禅道用户无法对接MS,请修改 https://www.tapd.cn/55049933/s/1063716 --- .../track/issue/client/ZentaoGetClient.java | 15 ++++++++++++--- .../track/issue/client/ZentaoPathInfoClient.java | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/issue/client/ZentaoGetClient.java b/backend/src/main/java/io/metersphere/track/issue/client/ZentaoGetClient.java index ac6ea599c2..4342a077aa 100644 --- a/backend/src/main/java/io/metersphere/track/issue/client/ZentaoGetClient.java +++ b/backend/src/main/java/io/metersphere/track/issue/client/ZentaoGetClient.java @@ -9,6 +9,8 @@ public class ZentaoGetClient extends ZentaoClient { private static final String LOGIN = "/?m=user&f=login&t=json&zentaosid="; private static final String SESSION_GET="/?m=api&f=getSessionID&t=json"; private static final String BUG_CREATE="&module=bug&methodName=create&t=json&zentaosid="; + private static final String BUG_UPDATE = "&module=bug&methodName=update¶ms=bugID={0}&t=json&zentaosid={1}"; + private static final String BUG_DELETE = "/?m=bug&f=delete&bugID={0}&confirm=yes&t=json&zentaosid={1}"; private static final String BUG_GET="&module=bug&methodName=getById¶ms=bugID={1}&t=json&zentaosid={2}"; private static final String STORY_GET="&module=story&methodName=getProductStories¶ms=productID={key}&t=json&zentaosid="; private static final String USER_GET="&module=user&methodName=getList&t=json&zentaosid="; @@ -17,10 +19,11 @@ public class ZentaoGetClient extends ZentaoClient { private static final String REPLACE_IMG_URL=""; private static final Pattern IMG_PATTERN = Pattern.compile("m=file&f=read&fileID=(.*?)\"/>"); + RequestUrl request = new RequestUrl(); + { - RequestUrl request = new RequestUrl(); - request.setLogin(getBaseUrl() + LOGIN); - request.setSessionGet(getBaseUrl() + SESSION_GET); + request.setLogin(getNotSuperModelUrl(LOGIN)); + request.setSessionGet(getNotSuperModelUrl(SESSION_GET)); request.setBugCreate(getUrl(BUG_CREATE)); request.setBugGet(getUrl(BUG_GET)); request.setStoryGet(getUrl(STORY_GET)); @@ -29,6 +32,8 @@ public class ZentaoGetClient extends ZentaoClient { request.setFileUpload(getUrl(FILE_UPLOAD)); request.setReplaceImgUrl(REPLACE_IMG_URL); request.setImgPattern(IMG_PATTERN); + request.setBugUpdate(getUrl(BUG_UPDATE)); + request.setBugDelete(getNotSuperModelUrl(BUG_DELETE)); requestUrl = request; } @@ -39,4 +44,8 @@ public class ZentaoGetClient extends ZentaoClient { private String getUrl(String url) { return getBaseUrl() + "/?m=api&f=getModel" + url; } + + private String getNotSuperModelUrl(String url) { + return getBaseUrl() + url; + } } diff --git a/backend/src/main/java/io/metersphere/track/issue/client/ZentaoPathInfoClient.java b/backend/src/main/java/io/metersphere/track/issue/client/ZentaoPathInfoClient.java index f473b87a30..68d113c96f 100644 --- a/backend/src/main/java/io/metersphere/track/issue/client/ZentaoPathInfoClient.java +++ b/backend/src/main/java/io/metersphere/track/issue/client/ZentaoPathInfoClient.java @@ -20,8 +20,9 @@ public class ZentaoPathInfoClient extends ZentaoClient { private static final String REPLACE_IMG_URL = ""; private static final Pattern IMG_PATTERN = Pattern.compile("file-read-(.*?)\"/>"); + RequestUrl request = new RequestUrl(); + { - RequestUrl request = new RequestUrl(); request.setLogin(getUrl(LOGIN)); request.setSessionGet(getUrl(SESSION_GET)); request.setBugCreate(getUrl(BUG_CREATE));