fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import axios from 'axios'
import store from '@/store'
// 文件下载
export class UploadFile {
  fileUpload(data) {
    const baseUrl = `${process.env.VUE_APP_CURRENTMODE === 'development' ? '/afile/' : process.env.VUE_APP_FILE_BASE_URL}file/uploadBatch`
    return axios({
      url: baseUrl,
      method: 'POST',
      data,
      headers: {
        Authorization: 'Bearer ' + store.state.token
      },
      withCredentials: false // true 为不允许带 token, false 为允许
    })
  }
}
export default new UploadFile()