Explorar el Código

feat: Tracking批量下载接口加上错误处理

Jack Zhou hace 3 semanas
padre
commit
01b8c939d8

+ 6 - 0
src/views/Tracking/src/components/DownloadAttachment/src/DownloadAttachment.vue

@@ -219,6 +219,12 @@ const handleDownloadAllSelectedFiles = (label?: string) => {
           grouping: true
         })
         return
+      } else if (res.data?.code === 500) {
+        ElMessageBox.alert(res.data.message, 'Prompt', {
+          confirmButtonText: 'OK',
+          confirmButtonClass: 'el-button--dark'
+        })
+        return
       }
       const fileName = getFileNameFromContentDisposition(res.headers['content-disposition'])
       const blob = new Blob([res.data], { type: 'application/zip' })