Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mp-customer-people-recruitment-h5
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭佳妮(贵阳日报)
mp-customer-people-recruitment-h5
Commits
79fd8fda
Commit
79fd8fda
authored
Jul 31, 2024
by
李明环(东信)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复文件上传bug
parent
6bf883ea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
fileUpload.js
src/utils/fileUpload.js
+2
-1
No files found.
src/utils/fileUpload.js
View file @
79fd8fda
...
...
@@ -7,8 +7,9 @@ export const uploadFiles = async tempFiles => {
const
resToken
=
await
getUploadToken
();
const
plist
=
[];
tempFiles
.
forEach
(
file
=>
{
console
.
log
(
file
);
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
formData
=
new
FormData
();
formData
.
append
(
"token"
,
resToken
.
data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment