king
2022-09-21 f0c2cd1084f44bdbd3bc38c8daac88e16ca917cc
src/tabviews/zshare/fileupload/index.jsx
@@ -24,6 +24,7 @@
    compress: 'false',
    fileType: 'text',
    showprogress: false,
    maxSize: 0,
    filelist: []
  }
@@ -89,6 +90,7 @@
      filelist,
      compress,
      limit: config.limit || 2,
      maxSize: config.maxSize || 0,
      maxFile: maxFile,
      fileType: config.fileType || 'text'
    })
@@ -218,7 +220,7 @@
  }
  beforeUpload = (file) => {
    const { accepts, compress, limit, rduri } = this.state
    const { accepts, compress, limit, rduri, maxSize } = this.state
    if (accepts && file.name) {
      let pass = false
@@ -235,6 +237,16 @@
        return false
      }
    }
    if (maxSize) {
      let fileSize = file.size / 1024 / 1024
      if (fileSize > maxSize) {
        setTimeout(() => {
          this.onFail(`文件大小不可超过${maxSize}M`)
        }, 10)
        return false
      }
    }
    this.setState({
      showprogress: true,