Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
biz.qingxiao.com
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
wangxuelai
biz.qingxiao.com
Commits
605db5ef
Commit
605db5ef
authored
Feb 22, 2020
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
最新代码提交
parent
301d4c04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
uploadcourseware.js
src/models/uploadcourseware.js
+2
-1
index.js
src/utils/index.js
+6
-0
No files found.
src/models/uploadcourseware.js
View file @
605db5ef
...
...
@@ -14,6 +14,7 @@ import {
LocalStorage
,
getAudioDuration
,
getVideoDuration
,
getPptRandomFilename
,
}
from
'../utils/index'
;
let
axiosCancel
=
null
;
export
default
{
...
...
@@ -183,8 +184,8 @@ export default {
progressCallBack
,
duration
,
}
=
payload
;
const
filename
=
`
${
signature
.
dir
}${
getRandomFilename
(
file
.
name
)}
`
;
const
{
name
,
size
,
type
:
fileType
}
=
file
;
const
filename
=
`
${
signature
.
dir
}${
getFileType
(
fileType
).
filetype
==
4
?
getPptRandomFilename
(
file
.
name
)
:
getRandomFilename
(
file
.
name
)}
`
;
const
params
=
{
key
:
filename
,
policy
:
signature
.
policy
,
...
...
src/utils/index.js
View file @
605db5ef
...
...
@@ -11,6 +11,11 @@ function encode(data) {
function
decode
(
data
)
{
return
typeof
data
===
'string'
?
JSON
.
parse
(
Base64
.
decode
(
data
))
:
data
;
}
function
getPptRandomFilename
(
filename
)
{
const
file
=
filename
.
match
(
/^
(
.*
)(\.[
A-z
]
+
)
$/
);
return
file
===
null
?
md5
(
String
(
Date
.
now
()
+
Math
.
random
())
+
filename
)
:
(
md5
(
String
(
Date
.
now
()
+
Math
.
random
())
+
file
[
1
])
+
file
[
2
]);
}
function
getRandomFilename
(
filename
)
{
const
file
=
filename
.
match
(
/^
(
.*
)(\.[
A-z
]
+
)
$/
);
return
md5
(
String
(
Date
.
now
()
+
Math
.
random
()));
...
...
@@ -945,6 +950,7 @@ function btnPermission(menus, btnId) {
return
flag
;
}
export
{
getPptRandomFilename
,
voiceTimeFormat
,
getAudioDuration
,
pageIn
,
...
...
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