fix: 解决merge conflict

This commit is contained in:
sophie committed 2026-10-13 13:17:14 +08:00
1 parent e38e5a63fe
commit 7e7bcbd388
5 files changed
+78 -20

No files matched your search

-5
View File
@@ -168,11 +168,6 @@ export async function requestJson<T>(url: string, init?: RequestInit): Promise<T
const headers = new Headers(init?.headers || {});
const authHeaders = getAuthHeaders();
Object.entries(authHeaders).forEach(([k, v]) => headers.set(k, v as string));
// 带 body 的请求若未显式声明类型,统一补 JSON 头:否则 Flask get_json(silent=True)
// 会因 Content-Type 非 JSON 解析出 None,把有效载荷当空 body 处理(如订单交期回复保存被误判 400)。
if (init?.body && !headers.has('Content-Type')) {
headers.set('Content-Type', 'application/json');
}
const res = await fetchJsonResponse(url, { ...init, headers });
let data: any = null;