Commit 605db5ef authored by wangxuelai's avatar wangxuelai

最新代码提交

parent 301d4c04
...@@ -14,6 +14,7 @@ import { ...@@ -14,6 +14,7 @@ import {
LocalStorage, LocalStorage,
getAudioDuration, getAudioDuration,
getVideoDuration, getVideoDuration,
getPptRandomFilename,
} from '../utils/index'; } from '../utils/index';
let axiosCancel = null; let axiosCancel = null;
export default { export default {
...@@ -183,8 +184,8 @@ export default { ...@@ -183,8 +184,8 @@ export default {
progressCallBack, progressCallBack,
duration, duration,
} = payload; } = payload;
const filename = `${signature.dir}${getRandomFilename(file.name)}`;
const { name, size, type: fileType } = file; const { name, size, type: fileType } = file;
const filename = `${signature.dir}${getFileType(fileType).filetype == 4 ? getPptRandomFilename(file.name) : getRandomFilename(file.name)}`;
const params = { const params = {
key: filename, key: filename,
policy: signature.policy, policy: signature.policy,
......
...@@ -11,6 +11,11 @@ function encode(data) { ...@@ -11,6 +11,11 @@ function encode(data) {
function decode(data) { function decode(data) {
return typeof data === 'string' ? JSON.parse(Base64.decode(data)) : 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) { function getRandomFilename(filename) {
const file = filename.match(/^(.*)(\.[A-z]+)$/); const file = filename.match(/^(.*)(\.[A-z]+)$/);
return md5(String(Date.now() + Math.random())); return md5(String(Date.now() + Math.random()));
...@@ -945,6 +950,7 @@ function btnPermission(menus, btnId) { ...@@ -945,6 +950,7 @@ function btnPermission(menus, btnId) {
return flag; return flag;
} }
export { export {
getPptRandomFilename,
voiceTimeFormat, voiceTimeFormat,
getAudioDuration, getAudioDuration,
pageIn, pageIn,
......
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