Selaa lähdekoodia

feat: NG-98: AE-会员端与管理端系统时间不一致(管理端正确,会员端错误)

tyler 1 vuosi sitten
vanhempi
commit
5543ad4e1a
1 muutettua tiedostoa jossa 12 lisäystä ja 7 poistoa
  1. 12 7
      src/views/profile/components/UserCard.vue

+ 12 - 7
src/views/profile/components/UserCard.vue

@@ -30,7 +30,7 @@
 							</el-col>
 							<el-col :span="12">
 								<div class="grid-content bg-purple-light">
-									<span>{{ tool.formatDate(tool.getTimestamp()) }}</span>
+									<span>{{ nowDateTime }}</span>
 								</div>
 							</el-col>
 						</el-row>
@@ -132,14 +132,19 @@ export default {
 	data() {
 		return {
 			tool: tool,
-		}
+      nowTime: this.getTime()
+    }
 	},
-
-
-
+  computed: {
+    nowDateTime() {
+      return this.$moment(this.nowTime * 1000).utcOffset('+0100' ).format('YYYY-MM-DD HH:mm:ss') + ' (WAT)'
+    },
+  },
   methods: {
-
-
+    getTime() {
+      let dateObj = new Date()
+      return Math.round(dateObj.getTime() / 1000 + (0 * 86400))
+    }
   }
 }
 </script>