fix(接口定义): url 规范问题修改
This commit is contained in:
parent
1e6b252d12
commit
25caf3c48e
|
@ -43,7 +43,8 @@
|
||||||
<el-option :key="0" :value="''">
|
<el-option :key="0" :value="''">
|
||||||
<div style="margin-left: 40px">
|
<div style="margin-left: 40px">
|
||||||
<span style="font-size: 14px;color: #606266;font-weight: 48.93">{{$t('api_test.definition.select_comp.no_data')}},
|
<span style="font-size: 14px;color: #606266;font-weight: 48.93">{{$t('api_test.definition.select_comp.no_data')}},
|
||||||
</span><el-link type="primary" @click="createModules">{{$t('api_test.definition.select_comp.add_data')}}</el-link>
|
</span>
|
||||||
|
<el-link type="primary" @click="createModules">{{$t('api_test.definition.select_comp.add_data')}}</el-link>
|
||||||
</div>
|
</div>
|
||||||
</el-option>
|
</el-option>
|
||||||
</div>
|
</div>
|
||||||
|
@ -106,7 +107,6 @@
|
||||||
import {REQ_METHOD, API_STATUS} from "../../model/JsonData";
|
import {REQ_METHOD, API_STATUS} from "../../model/JsonData";
|
||||||
import MsJsr233Processor from "../processor/Jsr233Processor";
|
import MsJsr233Processor from "../processor/Jsr233Processor";
|
||||||
import {KeyValue} from "../../model/ApiTestModel";
|
import {KeyValue} from "../../model/ApiTestModel";
|
||||||
// import {append} from "./../../../../track/common/NodeTree";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsAddCompleteHttpApi",
|
name: "MsAddCompleteHttpApi",
|
||||||
|
@ -185,7 +185,7 @@
|
||||||
return path[0].path;
|
return path[0].path;
|
||||||
},
|
},
|
||||||
urlChange() {
|
urlChange() {
|
||||||
if (!this.httpForm.path) return;
|
if (!this.httpForm.path || this.httpForm.path.indexOf('?') === -1) return;
|
||||||
let url = this.getURL(this.addProtocol(this.httpForm.path));
|
let url = this.getURL(this.addProtocol(this.httpForm.path));
|
||||||
if (url) {
|
if (url) {
|
||||||
this.httpForm.path = decodeURIComponent("/" + url.hostname + url.pathname);
|
this.httpForm.path = decodeURIComponent("/" + url.hostname + url.pathname);
|
||||||
|
@ -202,7 +202,6 @@
|
||||||
getURL(urlStr) {
|
getURL(urlStr) {
|
||||||
try {
|
try {
|
||||||
let url = new URL(urlStr);
|
let url = new URL(urlStr);
|
||||||
console.log(urlStr)
|
|
||||||
url.searchParams.forEach((value, key) => {
|
url.searchParams.forEach((value, key) => {
|
||||||
if (key && value) {
|
if (key && value) {
|
||||||
this.request.arguments.splice(0, 0, new KeyValue({name: key, required: false, value: value}));
|
this.request.arguments.splice(0, 0, new KeyValue({name: key, required: false, value: value}));
|
||||||
|
|
Loading…
Reference in New Issue