| | |
| | | const USER_INFO_KEY = "user-info"; |
| | | const DICT_KEY = "dict"; |
| | | const TEAM_ID_KEY = "team-id"; |
| | | const PREPARE_ID_KEY = "prepare-id"; |
| | | import { type DictData } from "@/api/system/dict"; |
| | | |
| | | // 设置 token |
| | |
| | | uni.removeStorageSync(TEAM_ID_KEY); |
| | | } |
| | | |
| | | // 设置生产准备ID |
| | | export function setPrepareId(prepareId: string | number) { |
| | | uni.setStorageSync(PREPARE_ID_KEY, prepareId); |
| | | } |
| | | |
| | | // 获取生产准备ID |
| | | export function getPrepareId(): string | number | null { |
| | | return uni.getStorageSync(PREPARE_ID_KEY) || null; |
| | | } |
| | | |
| | | // 清除生产准备ID |
| | | export function clearPrepareId() { |
| | | uni.removeStorageSync(PREPARE_ID_KEY); |
| | | } |
| | | |
| | | // 清除所有缓存信息 |
| | | export function clearAll() { |
| | | clearToken(); |
| | | clearUserInfo(); |
| | | clearDictCache(); |
| | | clearTeamId(); |
| | | clearPrepareId(); |
| | | } |