change local storage to session storage in api
This commit is contained in:
parent
7d0616add7
commit
c618c361b8
|
@ -40,15 +40,15 @@ class IAPIObject {
|
|||
/** @returns {ThisType} */
|
||||
static restoreFromLocalStorage() {
|
||||
_checkStorageSupport();
|
||||
if (!window.localStorage.getItem(this.storage_key))
|
||||
if (!window.sessionStorage.getItem(this.storage_key))
|
||||
return false;
|
||||
return new APIToken(window.localStorage.getItem(this.storage_key));
|
||||
return new APIToken(window.sessionStorage.getItem(this.storage_key));
|
||||
}
|
||||
|
||||
/** @returns {boolean} */
|
||||
static isCached() {
|
||||
this._checkStorageSupport();
|
||||
if (window.localStorage.getItem(this.storage_key)) {
|
||||
if (window.sessionStorage.getItem(this.storage_key)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class IAPIObject {
|
|||
saveToLocalStorage() {
|
||||
this._IcheckStorageSupport();
|
||||
|
||||
window.localStorage.setItem(this._getStorageKey(), JSON.stringify(this));
|
||||
window.sessionStorage.setItem(this._getStorageKey(), JSON.stringify(this));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue