From 89f89ae81e077ef9d6c7da2fce89f9f870776a54 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Mon, 21 Mar 2022 18:29:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E9=9B=86=E6=88=90tapd=E8=BE=93=E5=85=A5=E6=97=A0=E6=95=88?= =?UTF-8?q?=E7=9A=84id=20,=20=E7=82=B9=E5=87=BB=E5=88=9B=E5=BB=BA=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1011485 --user=李玉号 【项目设置】-集成第三方tapd 输入无效的id , 点击创建缺陷 会报错 https://www.tapd.cn/55049933/s/1122492 --- .../main/java/io/metersphere/track/issue/TapdPlatform.java | 5 +++++ backend/src/main/resources/i18n/messages_en_US.properties | 1 + backend/src/main/resources/i18n/messages_zh_CN.properties | 1 + backend/src/main/resources/i18n/messages_zh_TW.properties | 1 + 4 files changed, 8 insertions(+) diff --git a/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java b/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java index 341fb5eb72..969a79997e 100644 --- a/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/TapdPlatform.java @@ -12,6 +12,7 @@ import io.metersphere.commons.utils.BeanUtils; import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.SessionUtils; import io.metersphere.dto.UserDTO; +import io.metersphere.i18n.Translator; import io.metersphere.service.SystemParameterService; import io.metersphere.track.dto.DemandDTO; import io.metersphere.track.issue.client.TapdClient; @@ -171,6 +172,10 @@ public class TapdPlatform extends AbstractIssuePlatform { @Override public List getPlatformUser() { + Boolean exist = checkProjectExist(getProjectId(projectId)); + if (!exist) { + MSException.throwException(Translator.get("tapd_project_not_exist")); + } List users = new ArrayList<>(); JSONArray res = tapdClient.getPlatformUser(getProjectId(projectId)); for (int i = 0; i < res.size(); i++) { diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index 1fa83e39b3..01f527da87 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -164,6 +164,7 @@ id_repeat_in_table=ID is repeat in table step_model_tip=Step description fill in STEP, text description please fill in TEXT (not required) case_status_not_exist=The use case status must be Prepare, Underway way and Completed issue_project_not_exist=ID does not exist or other errors +tapd_project_not_exist=The associated TAPD item ID does not exist #ldap ldap_url_is_null=LDAP address is empty ldap_dn_is_null=LDAP binding DN is empty diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 1ca48b1f54..38dd3c940d 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -164,6 +164,7 @@ id_repeat_in_table=表格内ID重复 step_model_tip=步骤描述填写 STEP,文本描述请填写 TEXT (非必填) case_status_not_exist=用例状态必须为未开始(Prepare)、进行中(Underway)、已完成(Completed) issue_project_not_exist=ID不存在或其它错误 +tapd_project_not_exist=关联的TAPD项目ID不存在 #ldap ldap_url_is_null=LDAP地址为空 ldap_dn_is_null=LDAP绑定DN为空 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 8efda9cf75..d529da4857 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -164,6 +164,7 @@ id_repeat_in_table=表格內ID重復 step_model_tip=步驟描述填寫 STEP,文本描述請填寫 TEXT (非必填) case_status_not_exist=用例狀態必須為未開始(Prepare)、進行中(Underway)、已完成(Completed) issue_project_not_exist=ID不存在或其它錯誤 +tapd_project_not_exist=關聯的TAPD項目ID不存在 #ldap ldap_url_is_null=LDAP地址為空 ldap_dn_is_null=LDAP綁定DN為空