chore: bump version to 0.0.35, update storage reference to globalThis.localStorage, and add beforeRequest option to QueryOptions

This commit is contained in:
2026-01-03 19:12:56 +08:00
parent 4133b7a360
commit d4db81c58c
3 changed files with 17 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ export class QueryClient extends Query {
constructor(opts?: QueryOptions & { tokenName?: string; storage?: Storage; io?: boolean }) {
super(opts);
this.tokenName = opts?.tokenName || 'token';
this.storage = opts?.storage || localStorage;
this.storage = opts?.storage || globalThis.localStorage;
this.beforeRequest = async (opts) => {
const token = this.token || this.getToken();
if (token) {