fix(接口测试): 修复接口定义请求路径包含空格,提示路径无效的缺陷

--bug=1012800 --user=赵勇 [接口定义]github#13036接口定义,请求路径包含空格,提示路径无效
https://www.tapd.cn/55049933/s/1154831
This commit is contained in:
wxg0103 2022-05-09 16:50:54 +08:00 committed by 刘瑞斌
parent 356343ff57
commit 818fa49eaf
3 changed files with 6 additions and 6 deletions

View File

@ -78,7 +78,7 @@
},
data() {
let validateURL = (rule, value, callback) => {
if (!this.httpForm.path.startsWith("/") || this.httpForm.path.match(/\s/) != null) {
if (!this.httpForm.path.startsWith("/")) {
callback(this.$t('api_test.definition.request.path_valid_info'));
}
callback();
@ -112,7 +112,7 @@
saveApi() {
this.$refs['httpForm'].validate((valid) => {
if (valid) {
if (this.httpForm.path && this.httpForm.path.match(/\s/) != null) {
if (this.httpForm.path) {
this.$error(this.$t("api_test.definition.request.path_valid_info"));
return false;
}

View File

@ -74,7 +74,7 @@
},
data() {
let validateURL = (rule, value, callback) => {
if (!this.httpForm.path.startsWith("/") || this.httpForm.path.match(/\s/) != null) {
if (!this.httpForm.path.startsWith("/")) {
callback(this.$t('api_test.definition.request.path_valid_info'));
}
callback();
@ -120,7 +120,7 @@
saveApi(saveAs) {
this.$refs['httpForm'].validate((valid) => {
if (valid) {
if (this.httpForm.path && this.httpForm.path.match(/\s/) != null) {
if (this.httpForm.path) {
this.$error(this.$t("api_test.definition.request.path_valid_info"));
return false;
}

View File

@ -220,7 +220,7 @@ export default {
},
data() {
let validateURL = (rule, value, callback) => {
if (!this.httpForm.path.startsWith("/") || this.httpForm.path.match(/\s/) != null) {
if (!this.httpForm.path.startsWith("/")) {
callback(this.$t('api_test.definition.request.path_valid_info'));
}
callback();
@ -497,7 +497,7 @@ export default {
},
getURL(urlStr) {
try {
let url = new URL(urlStr);
let url = urlStr;
if (url.search && url.search.length > 1) {
let params = url.search.substr(1).split("&");
params.forEach(param => {