swagger-axios-codegen
Advanced tools
Comparing version 0.16.12 to 0.16.13
@@ -181,18 +181,19 @@ "use strict"; | ||
function requestBodyString(method, parsedParameters, bodyParameter, requestBody, contentType, formData) { | ||
let tips = ''; | ||
if (method != 'post' && method != 'put') { | ||
tips = `/** 适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body */ \n | ||
console.warn('适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body') | ||
`; | ||
} | ||
return ` | ||
${tips} | ||
if (parsedParameters && bodyParameter && bodyParameter.length > 0 || !!requestBody || formData.length > 0) { | ||
const tips = `/** 适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body */ \n | ||
console.warn('适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body')`; | ||
return ` | ||
${method === 'post' || method === 'put' ? '' : tips} | ||
let data = ${parsedParameters && bodyParameter && bodyParameter.length > 0 | ||
? | ||
bodyParameter | ||
: !!requestBody | ||
? 'params.body' | ||
: 'null'} | ||
? | ||
bodyParameter | ||
: !!requestBody | ||
? 'params.body' | ||
: 'null'} | ||
${contentType === 'multipart/form-data' ? formData : ''} | ||
configs.data = data;`; | ||
} | ||
return ''; | ||
} | ||
@@ -199,0 +200,0 @@ /** serviceTemplate */ |
{ | ||
"name": "swagger-axios-codegen", | ||
"version": "0.16.12", | ||
"version": "0.16.13", | ||
"main": "./dist/index", | ||
@@ -5,0 +5,0 @@ "typings": "./dist/", |
Sorry, the diff of this file is not supported yet
207396
2816