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} */
|
/** @returns {ThisType} */
|
||||||
static restoreFromLocalStorage() {
|
static restoreFromLocalStorage() {
|
||||||
_checkStorageSupport();
|
_checkStorageSupport();
|
||||||
if (!window.localStorage.getItem(this.storage_key))
|
if (!window.sessionStorage.getItem(this.storage_key))
|
||||||
return false;
|
return false;
|
||||||
return new APIToken(window.localStorage.getItem(this.storage_key));
|
return new APIToken(window.sessionStorage.getItem(this.storage_key));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {boolean} */
|
/** @returns {boolean} */
|
||||||
static isCached() {
|
static isCached() {
|
||||||
this._checkStorageSupport();
|
this._checkStorageSupport();
|
||||||
if (window.localStorage.getItem(this.storage_key)) {
|
if (window.sessionStorage.getItem(this.storage_key)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -62,7 +62,7 @@ class IAPIObject {
|
||||||
saveToLocalStorage() {
|
saveToLocalStorage() {
|
||||||
this._IcheckStorageSupport();
|
this._IcheckStorageSupport();
|
||||||
|
|
||||||
window.localStorage.setItem(this._getStorageKey(), JSON.stringify(this));
|
window.sessionStorage.setItem(this._getStorageKey(), JSON.stringify(this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue