Browse Source

加错误提示

chenken 6 năm trước cách đây
mục cha
commit
bb2a66ccee
1 tập tin đã thay đổi với 8 bổ sung1 xóa
  1. 8 1
      src/modules/oe/views/examScheduling.vue

+ 8 - 1
src/modules/oe/views/examScheduling.vue

@@ -455,7 +455,7 @@ export default {
                   }
                 )
                 .then(response => {
-                  if (response.data) {
+                  if (response.data && response.data.byteLength > 0) {
                     var blob = new Blob([response.data], {
                       type: "application/zip"
                     });
@@ -469,6 +469,13 @@ export default {
                     a.target = "_blank";
                     a.click();
                     URL.revokeObjectURL(url);
+                  } else {
+                    this.$notify({
+                      title: "提示",
+                      message: "无相关文件",
+                      type: "error",
+                      duration: 2000
+                    });
                   }
                   this.loading = false;
                 })