update
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import request from "../utils/request.js";
|
||||
import Method from "./Method.js";
|
||||
import Qiniu from "../utils/Qiniu.js";
|
||||
|
||||
const system = {
|
||||
getData: async (params) => {
|
||||
@@ -31,31 +32,26 @@ const system = {
|
||||
});
|
||||
})
|
||||
},
|
||||
uploadFile: async (file) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
getUploadToken: async () => {
|
||||
return request({
|
||||
UN_AES: true,
|
||||
url: '/admin/upload/upload',
|
||||
method: Method.POST,
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data; boundary=--------------------------611824495457697861278283'
|
||||
}
|
||||
url: `/${import.meta.env.VITE_BUILD_MODE === 'admin' ? 'admin' : 'index'}/Upload/webToken`,
|
||||
method: Method.GET,
|
||||
});
|
||||
},
|
||||
uploadFile: async (file) => {
|
||||
const qiniu = await Qiniu.getInstance();
|
||||
const path = await qiniu.uploadFile(file);
|
||||
return {
|
||||
data: path,
|
||||
}
|
||||
},
|
||||
uploadFile2: async (file) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return request({
|
||||
UN_AES: true,
|
||||
url: '/index/upload/upload',
|
||||
method: Method.POST,
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data; boundary=--------------------------611824495457697861278283'
|
||||
}
|
||||
});
|
||||
const qiniu = await Qiniu.getInstance();
|
||||
const path = await qiniu.uploadFile(file);
|
||||
return {
|
||||
data: path,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user