From 1187936c713bae2ad43063900c7bee80502e091d Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 19 十一月 2025 17:06:42 +0800
Subject: [PATCH] fix: 重构拉丝报工

---
 src/pages/production/detail/twistDetail.vue |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/pages/production/detail/twistDetail.vue b/src/pages/production/detail/twistDetail.vue
index b63840d..0f7be88 100644
--- a/src/pages/production/detail/twistDetail.vue
+++ b/src/pages/production/detail/twistDetail.vue
@@ -41,7 +41,7 @@
 import { onLoad } from "@dcloudio/uni-app";
 import ProductCard from "@/components/product_card/index.vue";
 import TwistApi from "@/api/product/twist";
-import { getPrepareId, setPrepareId } from "@/utils/cache";
+import { getPrepareId, setPrepareId, clearPrepareId } from "@/utils/cache";
 import HomeApi from "@/api/home";
 
 const paramsId = ref();
@@ -72,9 +72,14 @@
     const { data } = await HomeApi.getIndex();
     if (data && data.prepareId) {
       setPrepareId(data.prepareId);
+    } else {
+      // 濡傛灉娌℃湁 prepareId锛屾竻绌虹紦瀛�
+      clearPrepareId();
     }
   } catch (error) {
     console.error("鑾峰彇鐢熶骇鍑嗗ID澶辫触:", error);
+    // 鑾峰彇澶辫触鏃朵篃娓呯┖缂撳瓨
+    clearPrepareId();
   }
 };
 

--
Gitblit v1.9.3