浏览代码

调整阿里云OSS上传后的文件名

梁展鹏 3 年之前
父节点
当前提交
adcd59ed54
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/utils/ali-oss.js
  2. 1 1
      src/views/photographerManagement/photoVerify/modal/ali-oss-multi.vue

+ 1 - 1
src/utils/ali-oss.js

@@ -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()}`
 }

+ 1 - 1
src/views/photographerManagement/photoVerify/modal/ali-oss-multi.vue

@@ -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)