temp
This commit is contained in:
parent
fd5437292a
commit
0570acb78f
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@kevisual/query",
|
||||
"version": "0.0.15-alpha.1",
|
||||
"version": "0.0.15",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
@ -22,7 +22,14 @@ export const adapter = async (opts: AdapterOpts, overloadOpts?: RequestInit) =>
|
||||
controller.abort();
|
||||
}, timeout);
|
||||
let method = overloadOpts?.method || opts.method || 'POST';
|
||||
let url = new URL(opts.url, window.location.origin);
|
||||
let origin = '';
|
||||
let url: URL;
|
||||
if (opts?.url?.startsWith('http')) {
|
||||
url = new URL(opts.url);
|
||||
} else {
|
||||
origin = window?.location?.origin || 'http://localhost:11015';
|
||||
url = new URL(opts.url, origin);
|
||||
}
|
||||
const isGet = method === 'GET';
|
||||
if (isGet) {
|
||||
url.search = new URLSearchParams(opts.body).toString();
|
||||
|
Loading…
x
Reference in New Issue
Block a user