fix(接口定义): 修复导入API 编辑问题

This commit is contained in:
fit2-zhao 2020-12-17 15:02:39 +08:00
parent 9d9f949414
commit 3dda8e849d
3 changed files with 28 additions and 18 deletions

View File

@ -199,6 +199,7 @@
} }
}, },
created() { created() {
if (this.parameters) {
if (this.parameters.length === 0 || this.parameters[this.parameters.length - 1].name) { if (this.parameters.length === 0 || this.parameters[this.parameters.length - 1].name) {
this.parameters.push(new KeyValue({ this.parameters.push(new KeyValue({
type: 'text', type: 'text',
@ -210,6 +211,7 @@
} }
} }
} }
}
</script> </script>
<style scoped> <style scoped>

View File

@ -182,6 +182,7 @@
if (!this.body.type) { if (!this.body.type) {
this.body.type = BODY_TYPE.FORM_DATA; this.body.type = BODY_TYPE.FORM_DATA;
} }
if (this.body.kvs) {
this.body.kvs.forEach(param => { this.body.kvs.forEach(param => {
if (!param.type) { if (!param.type) {
param.type = 'text'; param.type = 'text';
@ -189,6 +190,7 @@
}); });
} }
} }
}
</script> </script>
<style scoped> <style scoped>

View File

@ -27,7 +27,13 @@ export const DEFAULT_DATA = [{
export const REQ_METHOD = [ export const REQ_METHOD = [
{id: 'GET', label: 'GET'}, {id: 'GET', label: 'GET'},
{id: 'POST', label: 'POST'} {id: 'POST', label: 'POST'},
{id: 'PUT', label: 'PUT'},
{id: 'PATCH', label: 'PATCH'},
{id: 'DELETE', label: 'DELETE'},
{id: 'OPTIONS', label: 'OPTIONS'},
{id: 'HEAD', label: 'HEAD'},
{id: 'CONNECT', label: 'CONNECT'}
] ]
export const API_STATUS = [ export const API_STATUS = [