Commit 605db5ef authored by wangxuelai's avatar wangxuelai

最新代码提交

parent 301d4c04
......@@ -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,
......
......@@ -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,
......
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