Procházet zdrojové kódy

fix: 身页面问卷评估接口失败不显示虚假分数

API 失败时不再回填 score: 70,改为 score: null 并提示用户重试
Sisyphus Agent před 4 dny
rodič
revize
a268cb96c3

+ 6 - 6
cfc-frontend/pages/body-detail/dimension-questionnaire.vue

@@ -399,18 +399,18 @@ export default {
             suggestion: res.data && res.data.suggestion ? res.data.suggestion : ''
           }
           _this.step = 3
-        } else {
-          // Fallback: compute estimated score locally
+} else {
+          // 接口失败:不展示虚假评分,提示用户重试
           _this.result = {
-            score: 70,
-            level: 'good',
-            suggestion: '可根据评估结果关注相关健康维度。'
+            score: null,
+            level: '',
+            suggestion: '评估提交失败,请重试。'
           }
           _this.step = 3
         }
       }).catch(function() {
         _this.loading = false
-        _this.result = { score: 70, level: 'good', suggestion: '提交成功,可根据评估结果关注相关健康维度。' }
+        _this.result = { score: null, level: '', suggestion: '网络异常,请重试。' }
         _this.step = 3
       })
     },