Commit 79fd8fda authored by 李明环(东信)'s avatar 李明环(东信)

修复文件上传bug

parent 6bf883ea
...@@ -7,8 +7,9 @@ export const uploadFiles = async tempFiles => { ...@@ -7,8 +7,9 @@ export const uploadFiles = async tempFiles => {
const resToken = await getUploadToken(); const resToken = await getUploadToken();
const plist = []; const plist = [];
tempFiles.forEach(file => { tempFiles.forEach(file => {
console.log(file);
const nowDate = dayjs(new Date()).format("YYYY-MM-DD"); const nowDate = dayjs(new Date()).format("YYYY-MM-DD");
const suffix = file.type === "image/jpeg" ? ".jpg" : ".mp4"; const suffix = file.type.indexOf("image") != -1 ? ".jpg" : ".mp4";
const key = `v2MpPublishMedia/${nowDate}/${new Date().getTime()}${suffix}`; const key = `v2MpPublishMedia/${nowDate}/${new Date().getTime()}${suffix}`;
const formData = new FormData(); const formData = new FormData();
formData.append("token", resToken.data); formData.append("token", resToken.data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment