fix(接口测试): http请求去除空格

This commit is contained in:
wxg0103 2023-12-22 16:49:49 +08:00 committed by 刘瑞斌
parent 27733af365
commit 4f542b3d47
3 changed files with 10 additions and 4 deletions

View File

@ -334,8 +334,6 @@ export default {
this.sort(this.request.hashTree);
},
setParameter(data) {
// Path
data.path = data.path.trimEnd();
data.name = this.currentApi.name;
data.moduleId = this.currentApi.moduleId;
data.modulePath = this.currentApi.modulePath;
@ -433,7 +431,6 @@ export default {
setParameters(data) {
data.projectId = this.projectId;
this.request.name = this.currentApi.name;
this.request.path = data.path.trimEnd();
data.protocol = this.currentProtocol;
data.request = this.request;
data.request.name = data.name;

View File

@ -463,7 +463,7 @@ export default {
});
},
setParameter() {
this.request.path = this.httpForm.path;
this.request.path = this.httpForm.path.trimEnd();
this.request.method = this.httpForm.method;
if (this.httpForm && this.httpForm.request) {
this.httpForm.request.useEnvironment = undefined;
@ -783,6 +783,9 @@ export default {
if (url) {
this.httpForm.path = decodeURIComponent(this.httpForm.path.substr(0, this.httpForm.path.indexOf('?')));
}
if (this.httpForm.path) {
this.httpForm.path = this.httpForm.path.trimEnd();
}
},
addProtocol(url) {
if (url) {

View File

@ -23,6 +23,7 @@
v-model="api.request.path"
class="ms-htt-width"
size="small"
@change="trimPath"
:disabled="false" />
</el-form-item>
@ -872,6 +873,11 @@ export default {
}
}
},
trimPath() {
if (this.api.request.path) {
this.api.request.path = this.api.request.path.trimEnd();
}
}
},
created() {