spring
2025-11-19 1187936c713bae2ad43063900c7bee80502e091d
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();
  }
};