Merge remote-tracking branch 'origin/v1.0' into v1.0

This commit is contained in:
wenyann 2020-07-09 14:51:55 +08:00
commit 2543d9416a
2 changed files with 9 additions and 4 deletions

View File

@ -91,12 +91,11 @@
let url = new URL(this.addProtocol(this.request.url)); let url = new URL(this.addProtocol(this.request.url));
url.searchParams.forEach((value, key) => { url.searchParams.forEach((value, key) => {
if (key && value) { if (key && value) {
parameters.push(new KeyValue(key, value)); this.request.parameters.splice(0, 0, new KeyValue(key, value));
} }
}); });
// //
parameters.push(new KeyValue()); parameters.push(new KeyValue());
this.request.parameters = parameters;
this.request.url = this.getURL(url); this.request.url = this.getURL(url);
} catch (e) { } catch (e) {
this.$error(this.$t('api_test.request.url_invalid'), 2000) this.$error(this.$t('api_test.request.url_invalid'), 2000)
@ -128,7 +127,7 @@
return url; return url;
}, },
getURL(url) { getURL(url) {
return decodeURIComponent(url.origin + url.pathname) + "?" + url.searchParams.toString(); return decodeURIComponent(url.origin + url.pathname);
} }
}, },

View File

@ -394,7 +394,13 @@ class JMXRequest {
this.port = url.port; this.port = url.port;
this.protocol = url.protocol.split(":")[0]; this.protocol = url.protocol.split(":")[0];
if (this.method.toUpperCase() !== "GET") { if (this.method.toUpperCase() !== "GET") {
this.pathname += url.search.replace('&', '&'); // this.pathname += url.search.replace('&', '&');
this.pathname += '?';
request.parameters.forEach(parameter => {
if (parameter.name) {
this.pathname += (parameter.name + '=' + parameter.value + '&');
}
});
} }
} }
} }