Skip to content

Commit

Permalink
revert change
Browse files Browse the repository at this point in the history
  • Loading branch information
arkraft authored and Manweill committed Mar 15, 2024
1 parent 0827dac commit 6956938
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/templates/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,8 @@ ${options.useStaticMethod ? 'static' : ''} ${camelcase(
}

function requestBodyString(method: string, parsedParameters: [], bodyParameter: [], requestBody: string, contentType: string, formData: string) {
if (parsedParameters && bodyParameter && bodyParameter.length > 0 || !!requestBody) {

const tips = `/** 适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body */ \n
console.warn('适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body')`
if (method === 'post' || method === 'put') {
return `
${method === 'post' || method === 'put' ? '' : tips}
let data = ${parsedParameters && bodyParameter && bodyParameter.length > 0
?
bodyParameter
Expand All @@ -256,7 +250,9 @@ function requestBodyString(method: string, parsedParameters: [], bodyParameter:
${contentType === 'multipart/form-data' ? formData : ''}
configs.data = data;`
}
return ''
return `/** 适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body */ \n
console.warn('适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body')
`
}

/** serviceTemplate */
Expand Down

0 comments on commit 6956938

Please sign in to comment.