Skip to content

Commit

Permalink
fix:Content-Type 类型为 application/x-www-form-urlencoded 代码生成错误 @see #139
Browse files Browse the repository at this point in the history
… (#140)
  • Loading branch information
fengwuxp authored Feb 19, 2024
1 parent 90a81cf commit 2cc701d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/serviceController.njk
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export async function {{ api.functionName }}(
return request{{ ("<" + api.response.type + ">") | safe if genType === "ts" }}('{{ api.path }}', {
{% endif -%}
method: '{{ api.method | upper }}',
{%- if api.hasHeader and api.body.mediaType not in ["multipart/form-data", "application/x-www-form-urlencoded"]%}
{%- if api.hasHeader and api.body.mediaType not in ["multipart/form-data"]%}
headers: {
{%- if api.body.mediaType %}
'Content-Type': '{{ api.body.mediaType | safe }}',
Expand Down

0 comments on commit 2cc701d

Please sign in to comment.