Skip to content

Commit ba62651

Browse files
committed
chore: 优化提示信息, 只有 POST、PUT 等请求允许带body
1 parent 5c8fa09 commit ba62651

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/templates/template.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,13 @@ function requestBodyString(method: string, parsedParameters: [], bodyParameter:
250250
${contentType === 'multipart/form-data' ? formData : ''}
251251
configs.data = data;`
252252
}
253-
return `/** 适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body */ \n
254-
console.warn('适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body')
255-
`
253+
else {
254+
if (bodyParameter && bodyParameter.length > 0 || !!requestBody) {
255+
return `/** 适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body */ \n
256+
console.warn('适配移动开发(iOS13 等版本),只有 POST、PUT 等请求允许带body')
257+
`
258+
}
259+
}
256260
}
257261

258262
/** serviceTemplate */

0 commit comments

Comments
 (0)