refactor: pr代码优化

This commit is contained in:
chenjianxing 2021-01-25 10:10:21 +08:00
parent 7412faa7d9
commit 058c3b3dd4
3 changed files with 10 additions and 13 deletions

View File

@ -275,7 +275,6 @@ public class Swagger2Parser extends SwaggerAbstractParser {
} else {
propertyList.add(new JSONObject());
}
jsonObject.put(key, propertyList);
} else {
jsonObject.put(key, new ArrayList<>());

View File

@ -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;

View File

@ -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);