Guide to use axios
@fabien0102 已经在做这个了。
开始于 2025年2月17日。
评估
这个 Issue 还没有评估数据。
描述
Hello. I understand that in order to use axios we have to modify the backendFetcher.ts file. But I do not want to miss anything and introduce a bug. Thus it would be great if there was an official guide to use axios with this awesome tool.
My attempt:
export async function backendFetch<
TData,
TError,
TBody extends {} | FormData | undefined | null,
THeaders extends {},
TQueryParams extends {},
TPathParams extends {},
>({
url,
method,
body,
headers,
pathParams,
queryParams,
signal,
}: BackendFetcherOptions<
TBody,
THeaders,
TQueryParams,
TPathParams
>): Promise<TData> {
// $axios is my axios instance with an interceptor
const response = await $axios({
url: `${baseUrl}${resolveUrl(url, queryParams, pathParams)}`,
method: method.toUpperCase(),
signal: signal,
data: body
? body instanceof FormData
? body
: JSON.stringify(body)
: undefined,
headers: { "Content-Type": "application/json", ...headers },
});
return response.data;
}
- 主要语言
- TypeScript
- 星标
- 635
- 派生
- 82
- 平均合并
- 1 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fabien0102/openapi-codegen 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
fabien0102/openapi-codegen#343 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
fabien0102/openapi-codegen#342 ·
-
update dependencies & removed unused deprecated可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 25/100
fabien0102/openapi-codegen#354 · 1 条评论 ·
-
deepMerge mutates its arguments, corrupting request payloads across calls可能已有人在做 @richard-willis-chevin 于 66 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
fabien0102/openapi-codegen#349 ·
-
Error when migrating to typesrcipt v7可能已有人在做 @fujikky 于 65 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 45/100
fabien0102/openapi-codegen#348 · 1 条评论 ·
查看 fabien0102/openapi-codegen 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
marmelab/react-admin#11431 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
db-ux-design-system/core-web#8655 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
stripe/react-stripe-js#728 ·
-
[Upload Grade C dataset] the pop-up changes it's size while uploading the document => Jumping effect未关闭bug
难度 2/5 1-3 小时 新手友好度 66/100
epam/statgpt-admin-frontend#305 ·
维护者通常 1 天内回复