Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(API,Case): add friendly alter when run api or case without config #160

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading