赵士淞
2023-05-09 b8441a1ac74d2c3325dd36d69ced511f19cd760b
1
2
3
4
5
6
7
8
9
10
11
import axios from 'axios'
import { getToken } from '@/utils/auth'
 
export function upload(api, file) {
  var data = new FormData()
  data.append('file', file)
  const config = {
    headers: { 'Authorization': getToken() }
  }
  return axios.post(api, data, config)
}