【前端】智能库房综合管理系统前端项目
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

3 years ago
  1. import axios from 'axios'
  2. import { getToken } from '@/utils/auth'
  3. export function upload(api, file) {
  4. var data = new FormData()
  5. data.append('file', file)
  6. const config = {
  7. headers: { 'Authorization': getToken() }
  8. }
  9. return axios.post(api, data, config)
  10. }
  11. // 档案上传附件
  12. export function archivesUpload(api, file, categoryId) {
  13. var data = new FormData()
  14. data.append('file', file)
  15. data.append('categoryId', categoryId)
  16. const config = {
  17. headers: { 'Authorization': getToken() }
  18. }
  19. return axios.post(api, data, config)
  20. }