Merge remote-tracking branch 'origin/master' into master

# Conflicts:
#	backend/src/main/java/io/metersphere/xpack
This commit is contained in:
Captain.B 2020-12-18 13:25:07 +08:00
commit 59f8f5106e
5 changed files with 20 additions and 8 deletions

View File

@ -201,6 +201,7 @@ public class ApiDefinitionService {
test.setName(request.getName()); test.setName(request.getName());
test.setPath(request.getPath()); test.setPath(request.getPath());
test.setProjectId(request.getProjectId()); test.setProjectId(request.getProjectId());
request.getRequest().setId(request.getId());
test.setRequest(JSONObject.toJSONString(request.getRequest())); test.setRequest(JSONObject.toJSONString(request.getRequest()));
test.setUpdateTime(System.currentTimeMillis()); test.setUpdateTime(System.currentTimeMillis());
test.setStatus(request.getStatus()); test.setStatus(request.getStatus());
@ -227,6 +228,7 @@ public class ApiDefinitionService {
test.setPath(request.getPath()); test.setPath(request.getPath());
test.setModuleId(request.getModuleId()); test.setModuleId(request.getModuleId());
test.setProjectId(request.getProjectId()); test.setProjectId(request.getProjectId());
request.getRequest().setId(request.getId());
test.setRequest(JSONObject.toJSONString(request.getRequest())); test.setRequest(JSONObject.toJSONString(request.getRequest()));
test.setCreateTime(System.currentTimeMillis()); test.setCreateTime(System.currentTimeMillis());
test.setUpdateTime(System.currentTimeMillis()); test.setUpdateTime(System.currentTimeMillis());

View File

@ -552,7 +552,7 @@
remove(row, node) { remove(row, node) {
const parent = node.parent const parent = node.parent
const hashTree = parent.data.hashTree || parent.data; const hashTree = parent.data.hashTree || parent.data;
const index = hashTree.findIndex(d => d.id != undefined && row.id != undefined && d.id === row.id) const index = hashTree.findIndex(d => d.resourceId != undefined && row.resourceId != undefined && d.resourceId === row.resourceId)
hashTree.splice(index, 1); hashTree.splice(index, 1);
this.sort(); this.sort();
this.reload(); this.reload();

View File

@ -3,7 +3,6 @@ import MsProject from "@/business/components/settings/project/MsProject";
export default { export default {
path: "/api", path: "/api",
name: "api", name: "api",
redirect: "/api/home",
components: { components: {
content: () => import('@/business/components/api/ApiTest') content: () => import('@/business/components/api/ApiTest')
}, },

View File

@ -11,7 +11,7 @@
<el-menu-item index="/track" v-permission="['test_manager','test_user','test_viewer']"> <el-menu-item index="/track" v-permission="['test_manager','test_user','test_viewer']">
{{ $t('test_track.test_track') }} {{ $t('test_track.test_track') }}
</el-menu-item> </el-menu-item>
<el-menu-item index="/api" v-permission="['test_manager','test_user','test_viewer']"> <el-menu-item index="/api" @click="active()" v-permission="['test_manager','test_user','test_viewer']">
{{ $t('commons.api') }} {{ $t('commons.api') }}
</el-menu-item> </el-menu-item>
<el-menu-item index="/performance" onselectstart="return false" <el-menu-item index="/performance" onselectstart="return false"
@ -47,7 +47,18 @@
}, },
methods: { methods: {
handleSelect(index) { handleSelect(index) {
console.log(index)
this.activeIndex = index this.activeIndex = index
},
active() {
if (this.activeIndex === '/api') {
if (this.$store.state.switch.value == 'new') {
window.location.href = "/#/api/home";
} else if (this.$store.state.switch.value == 'old') {
window.location.href = "/#/api/home_obsolete";
}
}
} }
} }
} }

@ -1 +1 @@
Subproject commit d39dafaf84b9c7a56cb51f2caf67dd7dfde5938c Subproject commit 010ad7a5f072a5e9d368c756a2473bbd20781433