调整阿里云OSS上传后的文件名 See merge request motive-power/yxl/yxl-web-admin-frontend!19
@@ -24,5 +24,5 @@ export const getFileNameUUID = () => {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
}
- return `${+new Date()}_${rx()}${rx()}`
+ return `${rx()}${rx()}`
@@ -159,7 +159,7 @@ export default {
temporary + 1,
fileNameLength
);
- let fileName = getFileNameUUID() + '.' + fileFormat;
+ let fileName = _that.$moment(new Date()).format('YYYYMMDDHHmm') + '_' + getFileNameUUID() + '.' + fileFormat;
// https://github.com/ali-sdk/ali-oss#multipartuploadname-file-options
client(_that.dataObj)