diff --git a/src/views/dietaryNutritionTips/dietaryNutritionTips11.vue b/src/views/dietaryNutritionTips/dietaryNutritionTips11.vue index b18663c..7a33667 100644 --- a/src/views/dietaryNutritionTips/dietaryNutritionTips11.vue +++ b/src/views/dietaryNutritionTips/dietaryNutritionTips11.vue @@ -153,12 +153,6 @@ export default { // 2. 尝试从带 OrgCode 标识的缓存读取 const cacheKey = `${dataKey}_${config.orgCode}`; - const localData = sessionStorage.getItem(cacheKey); - - if (localData) { - this.renderData(JSON.parse(localData), targetType); - return; - } // 3. 真正发起请求 this.isLoading = true; @@ -188,15 +182,17 @@ export default { } // 存储缓存 sessionStorage.setItem(cacheKey, JSON.stringify(res.result)); - // 渲染(传入 targetType 确保一致性) - this.renderData(res.result, targetType); + } + }).catch(() => {}).finally(() => { + this.isLoading = false; + + const localData = sessionStorage.getItem(cacheKey); + if (localData) { + this.renderData(JSON.parse(localData), targetType); } else { + // 如果连缓存都没有(彻底没数据),才手动开启下一次轮询 this.startBannerLoop(); } - }).catch(() => { - this.startBannerLoop(); - }).finally(() => { - this.isLoading = false; }); },