/*
*
*? 向緩存中存入數(shù)據(jù)*? 使用方式:*? 參數(shù)說(shuō)明:key的名稱(chēng) ,存入的數(shù)據(jù)*
*/
export const StorageSetFun = function (key, data) {
? ? window.sessionStorage.setItem(key, JSON.stringify(data));
};
/*
*
*? 在緩存中取數(shù)據(jù)*? 使用方式:*? 參數(shù)說(shuō)明:key的名稱(chēng)*
*/
export const StorageGetFun = function (key) {
? ? let data = window.sessionStorage.getItem(key);
? ? if(data === null){
? ? ? ? return false;
}
? ? return JSON.parse(data)
};
/*
*
*? 刪除緩存中的數(shù)據(jù)*? 使用方式:*? 參數(shù)說(shuō)明:key的名稱(chēng)*
*/
export const StorageDeleteFun = function (key) {
? ? window.sessionStorage.removeItem(key);
};