fix(接口测试): 修复接口定义请求路径包含空格,提示路径无效的缺陷
--bug=1012800 --user=赵勇 [接口定义]github#13036接口定义,请求路径包含空格,提示路径无效 https://www.tapd.cn/55049933/s/1154831
This commit is contained in:
parent
697a42aafc
commit
f439433cc7
|
@ -78,7 +78,7 @@
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
let validateURL = (rule, value, callback) => {
|
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(this.$t('api_test.definition.request.path_valid_info'));
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
|
@ -112,7 +112,7 @@
|
||||||
saveApi() {
|
saveApi() {
|
||||||
this.$refs['httpForm'].validate((valid) => {
|
this.$refs['httpForm'].validate((valid) => {
|
||||||
if (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"));
|
this.$error(this.$t("api_test.definition.request.path_valid_info"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
let validateURL = (rule, value, callback) => {
|
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(this.$t('api_test.definition.request.path_valid_info'));
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
|
@ -120,7 +120,7 @@
|
||||||
saveApi(saveAs) {
|
saveApi(saveAs) {
|
||||||
this.$refs['httpForm'].validate((valid) => {
|
this.$refs['httpForm'].validate((valid) => {
|
||||||
if (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"));
|
this.$error(this.$t("api_test.definition.request.path_valid_info"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
let validateURL = (rule, value, callback) => {
|
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(this.$t('api_test.definition.request.path_valid_info'));
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
|
@ -497,7 +497,7 @@ export default {
|
||||||
},
|
},
|
||||||
getURL(urlStr) {
|
getURL(urlStr) {
|
||||||
try {
|
try {
|
||||||
let url = new URL(urlStr);
|
let url = urlStr;
|
||||||
if (url.search && url.search.length > 1) {
|
if (url.search && url.search.length > 1) {
|
||||||
let params = url.search.substr(1).split("&");
|
let params = url.search.substr(1).split("&");
|
||||||
params.forEach(param => {
|
params.forEach(param => {
|
||||||
|
|
Loading…
Reference in New Issue