refactor: pr代码优化
This commit is contained in:
parent
7412faa7d9
commit
058c3b3dd4
|
@ -275,7 +275,6 @@ public class Swagger2Parser extends SwaggerAbstractParser {
|
|||
} else {
|
||||
propertyList.add(new JSONObject());
|
||||
}
|
||||
|
||||
jsonObject.put(key, propertyList);
|
||||
} else {
|
||||
jsonObject.put(key, new ArrayList<>());
|
||||
|
|
|
@ -49,8 +49,13 @@
|
|||
},
|
||||
methods: {
|
||||
validateSocket(socket) {
|
||||
// if (!socket) return true;
|
||||
if (socket !== ''){
|
||||
if (!socket) {
|
||||
this.httpConfig.domain = socket;
|
||||
this.httpConfig.port = '';
|
||||
this.httpConfig.socket = socket;
|
||||
return true;
|
||||
}
|
||||
|
||||
let urlStr = this.httpConfig.protocol + '://' + socket;
|
||||
let url = {};
|
||||
try {
|
||||
|
@ -67,13 +72,6 @@
|
|||
this.httpConfig.socket = this.httpConfig.domain + path;
|
||||
}
|
||||
return true;
|
||||
}else {
|
||||
this.httpConfig.domain = socket;
|
||||
this.httpConfig.port = '';
|
||||
this.httpConfig.socket = socket;
|
||||
return true;
|
||||
}
|
||||
|
||||
},
|
||||
validate() {
|
||||
let isValidate = false;
|
||||
|
|
|
@ -64,11 +64,11 @@ export class HttpConfig extends BaseConfig {
|
|||
constructor(options = {}) {
|
||||
super();
|
||||
|
||||
this.socket = undefined;
|
||||
this.domain = undefined;
|
||||
this.socket = '';
|
||||
this.domain = '';
|
||||
this.headers = [];
|
||||
this.protocol = 'https';
|
||||
this.port = undefined;
|
||||
this.port = '';
|
||||
|
||||
this.set(options);
|
||||
this.sets({headers: KeyValue}, options);
|
||||
|
|
Loading…
Reference in New Issue