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) {
if (storage) {
this.storage = new storage(this);
} else if (localStorage) {
} else if (typeof localStorage !== 'undefined') {
this.storage = localStorage;
} else {
this.storage = new MemoryStorage();