230320a303 5 months ago
parent
commit
f62abb455e

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-3c6063c9.84b706e7.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-678d2e46.768fb59c.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.f8887bed.js


+ 0 - 0
dist/static/js/chunk-060a14dc.97201b89.js → dist/static/js/chunk-060a14dc.5501b308.js


+ 0 - 0
dist/static/js/chunk-08ae1c6b.2c130731.js → dist/static/js/chunk-08ae1c6b.9d5173f1.js


+ 0 - 0
dist/static/js/chunk-106311f6.f67793c3.js → dist/static/js/chunk-106311f6.6ef2ea19.js


+ 0 - 0
dist/static/js/chunk-341d886c.78a4aace.js → dist/static/js/chunk-341d886c.f5e6ccd9.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-3c6063c9.268f57bb.js


+ 0 - 0
dist/static/js/chunk-41f61581.f7b04bdc.js → dist/static/js/chunk-41f61581.a1286993.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-4b7da375.93891d7d.js


+ 0 - 0
dist/static/js/chunk-593f9664.3636a867.js → dist/static/js/chunk-593f9664.4e3ceb63.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-5c93d3a3.4b77b203.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-678d2e46.8022e4ca.js


+ 0 - 0
dist/static/js/chunk-6d9461ae.94b00766.js → dist/static/js/chunk-6d9461ae.6717f170.js


+ 0 - 0
dist/static/js/chunk-7441b538.e26df983.js → dist/static/js/chunk-7441b538.8374fcb4.js


+ 0 - 0
dist/static/js/chunk-7b057567.d9fa7391.js → dist/static/js/chunk-7b057567.1d6f0e61.js


+ 0 - 0
dist/static/js/chunk-b68b3c70.92daca62.js → dist/static/js/chunk-b68b3c70.47a7d8bb.js


+ 0 - 0
dist/static/js/chunk-ea6fc480.c69f4adf.js → dist/static/js/chunk-ea6fc480.fac55b3c.js


+ 5 - 3
src/components/Common/UploadVideo.vue

@@ -41,7 +41,7 @@
 </template>
 <script>
 import * as qiniu from 'qiniu-js'
-import { arrToObj } from '@/utils'
+import { convertFileName } from '@/utils'
 export default {
   mixins,
   props: {
@@ -96,7 +96,7 @@ export default {
         debugLogLevel: 'INFO'
       }
       let putExtra = {
-        fname: "",
+        fname: '',
         params: {},
         mimeType: null
       }
@@ -115,11 +115,13 @@ export default {
 
       let subscription;
       // 调用sdk上传接口获得相应的observable,控制上传和暂停
-      let observable = qiniu.upload(curFile.raw, curFile.name, this.fileConfig.token, putExtra, config);
+      // let observable = qiniu.upload(curFile.raw, curFile.name, this.fileConfig.token, putExtra, config);
+      let observable = qiniu.upload(curFile.raw, convertFileName(curFile.name, 'onlyName'), this.fileConfig.token, putExtra, config);
       observable.subscribe(next, null, complete)
 
       // this.$refs.upload.submit();
     },
+
     handleRemove(file, fileList) {
       this.fileNextResObj = {}
       let cObj = this.cObj

+ 21 - 0
src/utils/index.js

@@ -136,6 +136,27 @@ export function arrToObj(arr) {
   return obj
 }
 
+
+export function convertFileName (oldFileName, type) {
+  const lastDotIndex = oldFileName.lastIndexOf('.')
+  if (lastDotIndex === -1) {
+    return ''
+  }
+  const now = new Date();
+  const year = now.getFullYear();
+  const month = String(now.getMonth() + 1).padStart(2, '0');
+  const day = String(now.getDate()).padStart(2, '0');
+  const hours = String(now.getHours()).padStart(2, '0');
+  const minutes = String(now.getMinutes()).padStart(2, '0');
+  const seconds = String(now.getSeconds()).padStart(2, '0');
+  const randomNum = Math.floor(Math.random() * 9000) + 1000;
+  if (type === 'onlyName') {
+    return `${year}${month}${day}${hours}${minutes}${seconds}-${randomNum}`
+  } else {
+    return `${year}${month}${day}${hours}${minutes}${seconds}-${randomNum}${oldFileName.substring(lastDotIndex)}`
+  }
+}
+
 export function noEmpty(val) {
   if (val === null || val === undefined || val === '') {
     return false

+ 2 - 0
src/views/house/components/popup/IndexEdit.vue

@@ -65,6 +65,8 @@
                           muted 
                           loop 
                           width="200"
+                          height="112"
+                          object-fit="cover"
                           >
                             <source 
                             :src="area.house_video" 

+ 3 - 2
src/views/room/components/popup/IndexEdit.vue

@@ -127,7 +127,7 @@
   </div>
 </template>
 <script>
-import { arrToObj } from '@/utils'
+import { arrToObj, convertFileName } from '@/utils'
 import handleMap from '@/components/Common/Map'
 import * as qiniu from 'qiniu-js'
 export default {
@@ -232,7 +232,8 @@ export default {
 
       let subscription;
       // 调用sdk上传接口获得相应的observable,控制上传和暂停
-      let observable = qiniu.upload(curFile.raw, curFile.name, this.fileConfig.token, putExtra, config);
+      // let observable = qiniu.upload(curFile.raw, curFile.name, this.fileConfig.token, putExtra, config);
+      let observable = qiniu.upload(curFile.raw, convertFileName(curFile.name, 'onlyName'), this.fileConfig.token, putExtra, config);
       observable.subscribe(next, null, complete)
 
       // this.$refs.upload.submit();

Some files were not shown because too many files changed in this diff