king
2020-07-03 aed1ff699140de60131bf9cc1332c98063c66721
src/tabviews/zshare/fileupload/index.jsx
@@ -8,10 +8,10 @@
import Utils from '@/utils/utils.js'
import './index.scss'
let Url = '/Upload'
if (process.env.NODE_ENV === 'production') {
  Url = document.location.origin + '/' + window.GLOB.service + 'zh-CN/Home/Upload'
}
// let Url = '/Upload'
// if (process.env.NODE_ENV === 'production') {
//   Url = document.location.origin + '/' + window.GLOB.service + 'zh-CN/Home/Upload'
// }
let service = ''
if (process.env.NODE_ENV === 'production') {
@@ -28,7 +28,6 @@
  }
  state = {
    baseUrl: Url,
    percent: 0,
    showprogress: false
  }
@@ -83,11 +82,11 @@
    })
  }
  getExtraData = () => {
    return {
      RootPath: 'Content/images/upload/'
    }
  }
  // getExtraData = () => {
  //   return {
  //     RootPath: 'Content/images/upload/'
  //   }
  // }
  shardupload = (params) => {
    let param = params.chunks.shift()
@@ -245,12 +244,12 @@
  render() {
    const { value, maxFile, fileType } = this.props
    const { showprogress, percent, baseUrl } = this.state
    const { showprogress, percent } = this.state
    let uploadable = ''
    let uploadable = 'fileupload-form-container '
    if (maxFile && maxFile > 0 && value && value.length >= maxFile) {
      uploadable = 'limit-fileupload'
      uploadable += 'limit-fileupload'
    }
    const props = {
@@ -258,12 +257,12 @@
      disabled: showprogress,
      listType: fileType,
      fileList: value,
      action: baseUrl,
      action: null,
      method: 'post',
      multiple: false,
      onChange: this.onChange,
      onRemove: this.onRemove,
      data: this.getExtraData,
      // data: this.getExtraData,
      beforeUpload: this.beforeUpload,
      className: uploadable
    }