Просмотр исходного кода

更新 DiskFile.vue 中对文件上传的处理

reghao 6 месяцев назад
Родитель
Сommit
b42abdffd3
1 измененных файлов с 7 добавлено и 7 удалено
  1. 7 7
      src/views/disk/DiskFile.vue

+ 7 - 7
src/views/disk/DiskFile.vue

@@ -360,15 +360,15 @@ export default {
     // ****************************************************************************************************************
     onFileAdded(file) {
       if (file.file.size > 1024 * 1024 * 1024 * 20) {
-        file.cancel()
-        this.$notify({
-          title: '提示',
-          message: '文件应小于 20GB',
-          type: 'warning',
-          duration: 3000
-        })
+        this.$message.warning('上传的文件应小于 20GB')
         return
       }
+
+      if (this.uploadForm.pid === null) {
+        this.$message.warning('请先选择文件目录')
+        return
+      }
+
       file.pause()
       hashFile(file.file).then(result => {
         this.startUpload(result.sha256sum, file)