globalFetch 함수 코드개선 및 디버깅 완료
This commit is contained in:
@@ -555,7 +555,6 @@ export async function globalFetch(url: string, arg: GlobalFetchArgs = {}): Promi
|
|||||||
return { ok: false, headers: {}, data: 'You are trying local request on web version. This is not allowed due to browser security policy. Use the desktop version instead, or use a tunneling service like ngrok and set the CORS to allow all.' }
|
return { ok: false, headers: {}, data: 'You are trying local request on web version. This is not allowed due to browser security policy. Use the desktop version instead, or use a tunneling service like ngrok and set the CORS to allow all.' }
|
||||||
|
|
||||||
// Simplify the globalFetch function: Detach built-in functions
|
// Simplify the globalFetch function: Detach built-in functions
|
||||||
const fetchData = async (url, arg) => {
|
|
||||||
if (forcePlainFetch) {
|
if (forcePlainFetch) {
|
||||||
return await fetchWithPlainFetch(url, arg);
|
return await fetchWithPlainFetch(url, arg);
|
||||||
}
|
}
|
||||||
@@ -566,7 +565,6 @@ export async function globalFetch(url: string, arg: GlobalFetchArgs = {}): Promi
|
|||||||
return await fetchWithCapacitor(url, arg);
|
return await fetchWithCapacitor(url, arg);
|
||||||
}
|
}
|
||||||
return await fetchWithProxy(url, arg);
|
return await fetchWithProxy(url, arg);
|
||||||
};
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
Reference in New Issue
Block a user