|
@@ -1,19 +1,22 @@
|
|
|
import { baseUrl, tenantId, apiPath } from '@/utils/config'
|
|
|
|
|
|
-const uploadApi = {
|
|
|
- file: '/menduner/system/file/upload',
|
|
|
- img: '/infra/file/upload'
|
|
|
-}
|
|
|
+// const uploadApi = {
|
|
|
+// file: '/menduner/system/file/upload',
|
|
|
+// img: '/infra/file/upload'
|
|
|
+// }
|
|
|
|
|
|
// 文件上传
|
|
|
-export const uploadFile = (file, type = 'file') => {
|
|
|
+export const uploadFile = (file, path) => {
|
|
|
uni.showLoading({
|
|
|
title: '上传中'
|
|
|
})
|
|
|
return new Promise((resolve, reject) => {
|
|
|
uni.uploadFile({
|
|
|
- url: baseUrl + apiPath + uploadApi[type],
|
|
|
+ url: baseUrl + apiPath + '/menduner/system/file/upload',
|
|
|
filePath: file,
|
|
|
+ formData: {
|
|
|
+ path
|
|
|
+ },
|
|
|
name: 'file',
|
|
|
header: {
|
|
|
Accept: '*/*',
|