fix(接口定义): 修复场景引用别的场景自定义脚本不执行的缺陷 (#18151)

--bug=1017074 --user=王孝刚
【接口测试】github
#18028,新建一个接口自动化场景,输入名称,然后引用一个场景,被引用场景里有自定义脚本,在未保存的情况下,选择环境,点调试,被引用场景自定义脚本不会被执行。
https://www.tapd.cn/55049933/s/1248955

Co-authored-by: wxg0103 <727495428@qq.com>
This commit is contained in:
MeterSphere Bot 2022-09-21 18:58:32 +08:00 committed by GitHub
parent d4cd37c7a3
commit b35c9c92d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -66,11 +66,11 @@
<script>
import {generateShareInfoWithExpired} from "@/network/share";
import {getCurrentProjectID} from "@/common/js/utils";
import MsTag from "@/business/components/common/components/MsTag";
import {getCurrentProjectID, getCurrentWorkspaceId, getUUID} from "@/common/js/utils";
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
const UiDownloadScreenshot = requireComponent.keys().length > 0 ? requireComponent("./ui/automation/report/UiDownloadScreenshot.vue") : {};
import {getCurrentProjectID, getCurrentWorkspaceId, getUUID} from "@/common/js/utils";
export default {
name: "MsApiReportViewHeader",
@ -161,7 +161,7 @@ export default {
pram.shareType = 'API_REPORT';
let thisHost = window.location.host;
let shareUrl = thisHost + "/shareApiReport";
if(this.isUi){
if (this.isUi) {
pram.shareType = 'UI_REPORT';
shareUrl = thisHost + "/shareUiReport";
}
@ -170,8 +170,8 @@ export default {
});
},
getProjectApplication() {
let path = "/API_SHARE_REPORT_TIME";
if(this.isUi){
let path = "/API_SHARE_REPORT_TIME";
if (this.isUi) {
path = "/UI_SHARE_REPORT_TIME";
}
this.$get('/project_application/get/' + getCurrentProjectID() + path, res => {

View File

@ -392,9 +392,9 @@ import {
handleCtrlREvent,
handleCtrlSEvent,
hasLicense,
hasPermission,
objToStrMap,
strMapToObj,
hasPermission
strMapToObj
} from "@/common/js/utils";
import "@/common/css/material-icons.css";
import OutsideClick from "@/common/js/outside-click";
@ -1393,7 +1393,7 @@ export default {
},
resetResourceId(hashTree) {
hashTree.forEach(item => {
item.resourceId = getUUID();
item.resourceId = item.resourceId || getUUID();
if (item.hashTree && item.hashTree.length > 0) {
this.resetResourceId(item.hashTree);
}