fix(接口测试): 修复分享的链接再次点击分享,新的页面错误的缺陷

--bug=1038176 --user=王孝刚 【接口测试】定义-API-接口详情-分享-打开分享页面-再点击分享-再打开新的链接页面错误
https://www.tapd.cn/55049933/s/1484739
This commit is contained in:
wxg0103 2024-04-01 11:18:01 +08:00 committed by 刘瑞斌
parent 50d9d37605
commit 6a89c25a92
5 changed files with 18 additions and 5 deletions

View File

@ -2,7 +2,7 @@
<div> <div>
<paramsTable <paramsTable
v-model:params="condition.assertions" v-model:params="condition.assertions"
:selectable="false" :selectable="true"
:columns="columns" :columns="columns"
:scroll="{ minWidth: '700px' }" :scroll="{ minWidth: '700px' }"
:default-param-item="defaultParamItem" :default-param-item="defaultParamItem"

View File

@ -168,7 +168,11 @@
function share() { function share() {
if (isSupported) { if (isSupported) {
copy(`${window.location.href}&dId=${previewDetail.value.id}`); // dId
const url = window.location.href;
const dIdParam = `&dId=${previewDetail.value.id}`;
const copyUrl = url.includes('dId') ? url.split('&dId')[0] : url;
copy(`${copyUrl}${dIdParam}`);
Message.success(t('apiTestManagement.shareUrlCopied')); Message.success(t('apiTestManagement.shareUrlCopied'));
} else { } else {
Message.error(t('common.copyNotSupport')); Message.error(t('common.copyNotSupport'));

View File

@ -176,7 +176,10 @@
function share() { function share() {
if (isSupported) { if (isSupported) {
copy(`${window.location.href}&cId=${caseDetail.value.id}`); const url = window.location.href;
const dIdParam = `&cId=${caseDetail.value.id}`;
const copyUrl = url.includes('cId') ? url.split('&cId')[0] : url;
copy(`${copyUrl}${dIdParam}`);
Message.success(t('apiTestManagement.shareUrlCopied')); Message.success(t('apiTestManagement.shareUrlCopied'));
} else { } else {
Message.error(t('common.copyNotSupport')); Message.error(t('common.copyNotSupport'));

View File

@ -561,7 +561,10 @@
function share(id: string) { function share(id: string) {
if (isSupported) { if (isSupported) {
copy(`${window.location.href}&dId=${id}`); const url = window.location.href;
const dIdParam = `&dId=${id}`;
const copyUrl = url.includes('dId') ? url.split('&dId')[0] : url;
copy(`${copyUrl}${dIdParam}`);
Message.success(t('apiTestManagement.shareUrlCopied')); Message.success(t('apiTestManagement.shareUrlCopied'));
} else { } else {
Message.error(t('common.copyNotSupport')); Message.error(t('common.copyNotSupport'));

View File

@ -199,7 +199,10 @@
function share() { function share() {
if (isSupported) { if (isSupported) {
copy(`${window.location.href}&sId=${scenario.value.id}`); const url = window.location.href;
const dIdParam = `&sId=${scenario.value.id}`;
const copyUrl = url.includes('sId') ? url.split('&sId')[0] : url;
copy(`${copyUrl}${dIdParam}`);
Message.success(t('common.copySuccess')); Message.success(t('common.copySuccess'));
} else { } else {
Message.error(t('common.copyNotSupport')); Message.error(t('common.copyNotSupport'));