fix(接口测试): 修复引用用例未同步更新问题

--bug=1010149 --user=赵勇 【接口测试】接口自动化引用的接口用例,更新后显示还是原来的参数 https://www.tapd.cn/55049933/s/1102477
This commit is contained in:
fit2-zhao 2022-02-09 18:34:28 +08:00 committed by fit2-zhao
parent bcd8950d40
commit 2890679f26
2 changed files with 13 additions and 0 deletions

View File

@ -52,6 +52,11 @@ public class MsHashTreeService {
private static final String VERSION_NAME = "versionName";
private static final String VERSION_ENABLE = "versionEnable";
private static final String URL = "url";
private static final String HEADERS = "headers";
private static final String REST = "rest";
private static final String BODY = "body";
private static final String ARGUMENTS = "arguments";
private static final String AUTH_MANAGER = "authManager";
public void setHashTree(JSONArray hashTree) {
// 将引用转成复制
@ -177,6 +182,11 @@ public class MsHashTreeService {
ElementUtil.dataFormatting(refElement);
JSONArray array = refElement.getJSONArray(HASH_TREE);
BeanUtils.copyBean(element, refElement);
element.put(HEADERS, refElement.get(HEADERS));
element.put(REST, refElement.get(REST));
element.put(BODY, refElement.get(BODY));
element.put(AUTH_MANAGER, refElement.get(AUTH_MANAGER));
element.put(ARGUMENTS, refElement.get(ARGUMENTS));
if (array != null) {
ElementUtil.mergeHashTree(element, refElement.getJSONArray(HASH_TREE));
}

View File

@ -251,6 +251,9 @@ export default {
if (this.request.num) {
this.isShowNum = true;
this.request.root = true;
if (this.request.id && this.request.referenced === 'REF') {
this.request.disabled = true;
}
this.getWorkspaceId(this.request.projectId);
} else {
this.isShowNum = false;