fix: 调整服务器时间

main
shengwen.chen 3 months ago
parent 2581ccd13c
commit 4c5b7ab193

@ -97,6 +97,7 @@
<script>
import { getDynamicTableHeader, getDynamicTableList, getGlobeConfig, getDepList } from '@/api/publishApi';
import { getServerDateTime } from '@/api/publishApi';
import { Carousel, CarouselItem, Select, Option } from 'element-ui';
import { statusToTxt, textToColor } from '@/utils/common';
import dayjs from 'dayjs';
@ -127,6 +128,7 @@ export default {
stayTime: 30,
depList: [],
selectDepList: [],
serverTimeStamp: '',
};
},
methods: {
@ -306,9 +308,13 @@ export default {
this.onGetDepList()
//
this.dateTimer = setInterval(() => {
this.currentDateTime = dayjs().format('YYYY-MM-DD HH:mm dddd');
}, 10000);
getServerDateTime().then(res => {
this.serverTimeStamp = dayjs(res['Data']).valueOf()
this.dateTimer = setInterval(() => {
this.currentDateTime = dayjs(this.serverTimeStamp).format(`YYYY-MM-DD HH:mm dddd`);
this.serverTimeStamp += 1000
}, 1000);
})
getDynamicTableHeader({
query: 'SSPCDP',

@ -98,6 +98,7 @@
<script>
import { getDynamicTableHeader, getDynamicTableList, getGlobeConfig, getAudio } from '@/api/publishApi';
import { getServerDateTime } from '@/api/publishApi';
import { Carousel, CarouselItem } from 'element-ui';
import dayjs from 'dayjs';
import { statusToTxt, textWaitToColor } from '@/utils/common';
@ -133,6 +134,7 @@ export default {
logoUrlBackup: "",
groupIndex: -1,
roomNameList: [],
serverTimeStamp: '',
};
},
methods: {
@ -324,10 +326,16 @@ export default {
this.$nextTick(() => {
this.onCalculate();
this.onGetblobe();
//
this.dateTimer = setInterval(() => {
this.currentDateTime = dayjs().format('YYYY-MM-DD HH:mm dddd');
}, 10000);
getServerDateTime().then(res => {
this.serverTimeStamp = dayjs(res['Data']).valueOf()
this.dateTimer = setInterval(() => {
this.currentDateTime = dayjs(this.serverTimeStamp).format(`YYYY-MM-DD HH:mm dddd`);
this.serverTimeStamp += 1000
}, 1000);
})
getDynamicTableHeader({
query: 'JSDHQDP',
}).then(res => {

Loading…
Cancel
Save