globalFetch 함수 코드개선 및 디버깅 완료

This commit is contained in:
testman
2024-03-25 06:06:41 +09:00
parent 7444090c9c
commit 0ebe82c629

View File

@@ -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);