|
|
@@ -169,19 +169,19 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
async mounted() {
|
|
|
- this.APITests = await APITestAPI.getAPITestInfosByProjectId(1);
|
|
|
+ this.APITests = await APITestAPI.getAPITestInfosByProjectId(this.$store.state.workspace.currentProjectId);
|
|
|
},
|
|
|
methods: {
|
|
|
async handleClick(action, id) {
|
|
|
switch (action) {
|
|
|
case 'create': {
|
|
|
this.showAPITestCreateModel = true;
|
|
|
- console.log(this.$store.state.workspace.currentProjectId);
|
|
|
+ // console.log(this.$store.state.workspace.currentProjectId);
|
|
|
break;
|
|
|
}
|
|
|
case 'trigger': {
|
|
|
await APITestAPI.executeAPITestByTestId(id);
|
|
|
- this.APITests = await APITestAPI.getAPITestInfosByProjectId(1);
|
|
|
+ this.APITests = await APITestAPI.getAPITestInfosByProjectId(this.$store.state.workspace.currentProjectId);
|
|
|
break;
|
|
|
}
|
|
|
case 'viewDetail': {
|
|
|
@@ -199,7 +199,7 @@ export default {
|
|
|
message: '删除成功!',
|
|
|
type: 'success',
|
|
|
});
|
|
|
- this.APITests = await APITestAPI.getAPITestInfosByProjectId(1);
|
|
|
+ this.APITests = await APITestAPI.getAPITestInfosByProjectId(this.$store.state.workspace.currentProjectId);
|
|
|
break;
|
|
|
}
|
|
|
default: {
|
|
|
@@ -225,14 +225,14 @@ export default {
|
|
|
await APITestAPI.createAPITest({
|
|
|
projectId: 1,
|
|
|
createTime: this.createAPITestForm.createTime,
|
|
|
- username: '大师兄',
|
|
|
+ username: '',
|
|
|
testName: this.createAPITestForm.testName,
|
|
|
url: this.createAPITestForm.url,
|
|
|
params: this.createAPITestForm.params,
|
|
|
method: this.createAPITestForm.method,
|
|
|
qps: this.createAPITestForm.qps,
|
|
|
});
|
|
|
- this.APITests = await APITestAPI.getAPITestInfosByProjectId(1);
|
|
|
+ this.APITests = await APITestAPI.getAPITestInfosByProjectId(this.$store.state.workspace.currentProjectId);
|
|
|
this.$refs.createAPITestForm.resetFields();
|
|
|
this.showAPITestCreateModel = false;
|
|
|
ElMessage.success({
|