From 8cc901ed214f3885b34a07d0520fbcfd50063439 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 19 十一月 2025 14:30:39 +0800
Subject: [PATCH] fix: 完成绞线自检,生产确认等功能新增
---
src/utils/cache.ts | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/src/utils/cache.ts b/src/utils/cache.ts
index 93b1a42..b136531 100644
--- a/src/utils/cache.ts
+++ b/src/utils/cache.ts
@@ -1,6 +1,8 @@
const TOKEN_KEY = "app-token";
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
@@ -48,9 +50,41 @@
uni.removeStorageSync(DICT_KEY);
}
+// 璁剧疆鐝粍ID
+export function setTeamId(teamId: string | number) {
+ uni.setStorageSync(TEAM_ID_KEY, teamId);
+}
+
+// 鑾峰彇鐝粍ID
+export function getTeamId(): string | number | null {
+ return uni.getStorageSync(TEAM_ID_KEY) || null;
+}
+
+// 娓呴櫎鐝粍ID
+export function clearTeamId() {
+ 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();
}
--
Gitblit v1.9.3