Explorar el Código

fix(frontend): 健康报告上传改用 upload-only 接口

远程 5f134095 将仅上传接口路由从 /report/upload 改为 /report/upload-only,
前端 uploadReportOnly 仍调旧路由命中一体化 uploadReport(返回详情无 draftId),
导致上传成功但 res.data.draftId 为空、不跳转确认页且 toast 显示 message=success。
修正 URL 为 /api/health/report/upload-only。
asus hace 1 mes
padre
commit
d27ef53eb3
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      cfc-frontend/utils/api.js

+ 3 - 3
cfc-frontend/utils/api.js

@@ -2125,7 +2125,7 @@ export const uploadReportOnly = (filePath, type) => {
   return new Promise((resolve, reject) => {
     const token = uni.getStorageSync('token')
     uni.uploadFile({
-      url: BASE_URL + '/api/health/report/upload' + (type ? '?type=' + type : ''),
+      url: BASE_URL + '/api/health/report/upload-only' + (type ? '?type=' + type : ''),
       filePath: filePath,
       name: 'file',
       header: {
@@ -2137,12 +2137,12 @@ export const uploadReportOnly = (filePath, type) => {
         if (data && data.code === 200) {
           resolve(data)
         } else {
-          console.warn('[API] 上传失败 ' + BASE_URL + '/api/health/report/upload' + ' code=' + (data && data.code || '') + ' msg=' + (data && data.message || ''))
+          console.warn('[API] 上传失败 ' + BASE_URL + '/api/health/report/upload-only' + ' code=' + (data && data.code || '') + ' msg=' + (data && data.message || ''))
           reject(data)
         }
       },
       fail: (err) => {
-        console.error('[API] 上传网络错误 ' + BASE_URL + '/api/health/report/upload', err)
+        console.error('[API] 上传网络错误 ' + BASE_URL + '/api/health/report/upload-only', err)
         reject(err)
       }
     })