zengyicheng 3 anni fa
parent
commit
295bfcc005
1 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 10 1
      src/components/pages/classRoom.vue

+ 10 - 1
src/components/pages/classRoom.vue

@@ -116,7 +116,7 @@ export default {
           cover: [],
           courseId:"9a4e8dbe-132e-438e-97db-b07eb01fa04c",
           title: "湖心亭看雪可可乐博模拟展示课件",
-          time: new Date().getTime(),
+          time: this.getNowTime(),
         },
       ],
       courseName: "",
@@ -164,6 +164,15 @@ export default {
         return v.toString(16);
       });
     },
+    getNowTime() {
+      const yy = new Date().getFullYear()
+      const MM = (new Date().getMonth() + 1) < 10 ? '0' + (new Date().getMonth() + 1) : (new Date().getMonth() + 1)
+      const dd = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
+      const HH = new Date().getHours() < 10 ? '0' + new Date().getHours() : new Date().getHours()
+      const mm = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
+      const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
+      return yy + '-' + MM + '-' + dd + ' ' + HH + ':' + mm + ':' + ss
+    },
     time() {
       if (!this.now) {
         this.now = new Date().getTime();