提取
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user