From d65dc5a39844245e6e5ceaf8c811f3b17871fbe4 Mon Sep 17 00:00:00 2001 From: "nathan.liu" Date: Mon, 17 Oct 2022 16:18:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(UI=E8=87=AA=E5=8A=A8=E5=8C=96):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DUI=E6=8A=A5=E5=91=8A=E5=88=86=E4=BA=AB=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E6=9C=89=E6=95=88=E6=9C=9F=E8=AE=BE=E7=BD=AE=E6=B2=A1?= =?UTF-8?q?=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1017328 --user=刘瑶 【UI测试】UI报告分享链接有效期设置没生效 https://www.tapd.cn/55049933/s/1264460 --- .../io/metersphere/api/service/ShareInfoService.java | 9 +++++++++ .../commons/constants/ProjectApplicationType.java | 6 +++++- backend/src/main/java/io/metersphere/xpack | 2 +- frontend/src/business/components/xpack | 2 +- .../template/report/ui/share/ShareUiReportTemplate.vue | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java b/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java index e27addca3e..03bdf5eaf8 100644 --- a/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java +++ b/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java @@ -579,6 +579,15 @@ public class ShareInfoService { projectId = reportResult.getProjectId(); } } + + if (StringUtils.equals(shareInfo.getShareType(), "UI_REPORT")) { + type = ProjectApplicationType.UI_SHARE_REPORT_TIME.toString(); + APIScenarioReportResult reportResult = extApiScenarioReportMapper.get(shareInfo.getCustomData()); + if (reportResult != null) { + projectId = reportResult.getProjectId(); + } + } + if (StringUtils.isBlank(type) || Strings.isBlank(projectId)) { millisCheck(System.currentTimeMillis() - shareInfo.getUpdateTime(), 1000 * 60 * 60 * 24, shareInfo.getId()); } else { diff --git a/backend/src/main/java/io/metersphere/commons/constants/ProjectApplicationType.java b/backend/src/main/java/io/metersphere/commons/constants/ProjectApplicationType.java index 0caeabbc3a..345995c0b1 100644 --- a/backend/src/main/java/io/metersphere/commons/constants/ProjectApplicationType.java +++ b/backend/src/main/java/io/metersphere/commons/constants/ProjectApplicationType.java @@ -67,5 +67,9 @@ public enum ProjectApplicationType { /** * 接口分享链接有效期 */ - API_SHARE_REPORT_TIME + API_SHARE_REPORT_TIME, + /** + * UI报告分享链接有效期 + */ + UI_SHARE_REPORT_TIME } diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index a9db2120f5..6fd455241b 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit a9db2120f547fd4cd88d6fb9ba115b182a9b80eb +Subproject commit 6fd455241b44c9d952979b68922801bb6a0bbe3d diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index c698d5eac1..74ec0740a0 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit c698d5eac1182ad0c51f4ababdcc16c4b713416b +Subproject commit 74ec0740a0bf12327a064c36b3d9e2ce07d5b1e4 diff --git a/frontend/src/template/report/ui/share/ShareUiReportTemplate.vue b/frontend/src/template/report/ui/share/ShareUiReportTemplate.vue index 8b68d48dcf..fed0053242 100644 --- a/frontend/src/template/report/ui/share/ShareUiReportTemplate.vue +++ b/frontend/src/template/report/ui/share/ShareUiReportTemplate.vue @@ -21,7 +21,7 @@ export default { this.shareId = getShareId(); getShareInfo(this.shareId, (data) => { if (!data) { - this.$error('报告已删除!'); + this.$error('链接已失效,请重新获取!'); return; } if (data.shareType === 'UI_REPORT') {