king
2020-01-03 4d62306be71cef7d62059f07199426f96353c412
src/tabviews/tableshare/fileupload/index.jsx
@@ -51,12 +51,10 @@
    }
  }
  getExtraData = file => {
    const param = new FormData()
    param.append('file', file)
    param.append('RootPath', 'Content/images/upload/')
    return param
  getExtraData = () => {
    return {
      RootPath: 'Content/images/upload/'
    }
  }
  shardupload = (file, shardSize, shardCount, i) => {
@@ -72,7 +70,6 @@
    if (i < shardCount) {
      i++
      Api.getFileUpload(file).then(res => {
        console.log(res)
        if (res) {
          this.setState({
            percent: Math.floor(100 * (i / shardCount))
@@ -96,7 +93,7 @@
  beforeUpload = (file, fileList) => {
    let shardSize = 200 * 1024 * 1024
    console.log(file)
    // console.log(file)
    if (file.size > shardSize) {
      this.setState({
@@ -121,6 +118,8 @@
      fileList: value,
      action: baseUrl,
      method: 'post',
      multiple: true,
      // headers: {'RootPath': 'Content/images/upload/'},
      onChange: this.onChange,
      onRemove: this.onRemove,
      data: this.getExtraData,
@@ -129,7 +128,7 @@
    return (
      <Upload {...props}>
        <Button>
          <Icon type="upload" /> Click to Upload
          <Icon type="upload" /> 点击上传
        </Button>
        {showprogress ? <Progress percent={percent} size="small" /> : null}
      </Upload>