允许用户自定义 hooks 中重写signal 参数,自定义超时时间

This commit is contained in:
qonmnop
2025-02-17 12:14:10 +08:00
committed by GitHub
parent 6855332092
commit fe55a2cd3c

View File

@@ -108,7 +108,7 @@ export const fetchPatcher = async (input, init, transOpts, apiSetting) => {
}
}
if (AbortSignal?.timeout) {
if (AbortSignal?.timeout && !init.signal) {
Object.assign(init, { signal: AbortSignal.timeout(TIMEOUT) });
}