Skip to content

Commit

Permalink
Merge pull request #160
Browse files Browse the repository at this point in the history
fix(API,Case): add friendly alter when run api or case without config
  • Loading branch information
lihuacai168 authored Jan 27, 2024
2 parents 3a8d43f + f00ac15 commit 9a9f69e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions web/src/pages/fastrunner/api/components/ApiBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ export default {
},
methods: {
reverseStatus() {
console.log(this.url)
console.log(this.config)
console.log(this.host)
// 如果没有选择配置的时候,并且api的不是http开头的, 并且不是变量的时候,提示用户选择配置
if (this.config.name === '请选择' && this.host === '请选择' && !this.url.startsWith("http") && !this.url.startsWith("$")){
this.$message.warning("请先在左上角选择配置再运行哦~")
return
}
this.save = !this.save;
this.run = true;
},
Expand Down
5 changes: 5 additions & 0 deletions web/src/pages/fastrunner/api/components/ApiList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,11 @@ export default {
},
// 运行API
handleRunAPI(id) {
// 如果没有选择配置的时候,并且api的不是http开头的, 并且不是变量的时候,提示用户选择配置
if (this.config === '请选择' && this.host === '请选择' && !this.currentRow.url.startsWith("http") && !this.currentRow.url.startsWith("$")){
this.$message.warning("请先在左上角选择配置再运行哦~")
return
}
this.loading = true;
this.$api.runAPIByPk(id, {
params: {
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/fastrunner/case/components/EditTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ export default {
this.$notify.warning({
title: '提示',
duration: this.$store.state.duration,
message: '测试用例必须包含配置'
message: '请先在左上角选择配置后,再运行用例哦~'
});
return false
}
Expand Down

0 comments on commit 9a9f69e

Please sign in to comment.