This commit is contained in:
saplf
2019-09-05 23:24:49 +08:00
parent df25ff4244
commit c8f919ce5a
19 changed files with 658 additions and 37 deletions

View File

@@ -3,6 +3,7 @@ const userKey = 'user-key';
const areaCodeKey = 'area-code-key';
const mineListKey = 'mine-list-key';
const coinsKey = 'coin-key';
const drawCoinsKey = 'draw-coin-key';
// user info from now on
function storeUser(user: any = undefined) {
@@ -72,6 +73,23 @@ function clearCoins() {
localStorage.removeItem(coinsKey);
}
// coin list info of draw page from now on
function storeDrawCoins(coins: any) {
localStorage.setItem(drawCoinsKey, JSON.stringify(coins));
}
function loadDrawCoins() {
try {
return JSON.parse(localStorage.getItem(drawCoinsKey) || 'null');
} catch (e) {
return null;
}
}
function clearDrawCoins() {
localStorage.removeItem(drawCoinsKey);
}
export {
storeUser,
loadUser,
@@ -87,4 +105,8 @@ export {
storeCoins,
loadCoins,
clearCoins,
storeDrawCoins,
loadDrawCoins,
clearDrawCoins,
}