// xuchao: 账号级本地缓存集中管理。权益页首屏会读这些缓存做兜底展示, // 换账号/退出时漏清就会把上一个账号的中奖状态、卡号、到期时间当成当前账号的数据展示。 const ACCOUNT_KEYS = ['token', 'phone', 'isAuth', 'hasWin', 'cardNumber', 'expiresTime', 'rightsCount', 'totalValueFen', 'authFlowStarted', 'authName', 'authIdNo'] export default { // 清空当前账号的本地会话与权益缓存(定位 lng/lat 属于设备信息,不在此列) clearAccountCache() { ACCOUNT_KEYS.forEach(key => uni.removeStorageSync(key)) }, // 账号标识(手机号) setAccountPhone(phone) { uni.setStorageSync('phone', phone) } }