You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
552 B
22 lines
552 B
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)
|
|
}
|
|
|
|
// 档案上传附件
|
|
export function archivesUpload(api, file, categoryId) {
|
|
var data = new FormData()
|
|
data.append('file', file)
|
|
data.append('categoryId', categoryId)
|
|
const config = {
|
|
headers: { 'Authorization': getToken() }
|
|
}
|
|
return axios.post(api, data, config)
|
|
}
|