fix: localStorage is not defined

This commit is contained in:
chenos 2022-07-15 20:45:43 +08:00
parent 9df35933d2
commit e2949362ba

View File

@ -187,7 +187,7 @@ export class APIClient {
private initStorage(storage?: any) { private initStorage(storage?: any) {
if (storage) { if (storage) {
this.storage = new storage(this); this.storage = new storage(this);
} else if (localStorage) { } else if (typeof localStorage !== 'undefined') {
this.storage = localStorage; this.storage = localStorage;
} else { } else {
this.storage = new MemoryStorage(); this.storage = new MemoryStorage();