This commit is contained in:
2023-05-19 17:16:58 +08:00
parent 30ee54dabb
commit 92b41010d0

View File

@@ -48,24 +48,13 @@ export default {
}, },
data () { data () {
return { return {
interTime: this.$store.getters.setTime,
timer: null,
dataInfo: {} dataInfo: {}
} }
}, },
created () { created () {
this.initData() this.initData()
this.refresh()
},
beforeDestroy () {
clearInterval(this.timer)
}, },
methods: { methods: {
refresh () {
this.timer = setInterval(() => {
this.initData()
}, this.interTime)
},
async initData () { async initData () {
let res = await queryHomePage() let res = await queryHomePage()
if (res.code === '1') { if (res.code === '1') {