赛事定时器

dev_202303
yujialong 2 years ago
parent f3ac5af564
commit 9b0c0a0f4f
  1. 2
      src/setting.js
  2. 1
      src/utils/api.js
  3. 12
      src/views/match/list/index.vue

@ -12,7 +12,7 @@ if (isDev) {
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' // host = 'https://huorantech.cn/'
host = 'http://192.168.31.151:9000/'// 榕 host = 'http://192.168.31.151:9000/'// 榕
// host = 'http://192.168.31.116:9000/'// 赓 // host = 'http://192.168.31.117:9000/'// 赓
} else if (isPro) { } else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/' jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
} }

@ -312,6 +312,7 @@ export default {
publishCompetition: `competition/competition/management/publishCompetition`, publishCompetition: `competition/competition/management/publishCompetition`,
detailsOfCompetitionStage: `competition/competition/management/detailsOfCompetitionStage`, detailsOfCompetitionStage: `competition/competition/management/detailsOfCompetitionStage`,
entryInformation: `competition/competition/team/entryInformation`, entryInformation: `competition/competition/team/entryInformation`,
getRedisCacheCompetition: `competition/competition/management/getRedisCache`,
// 赛事内容 // 赛事内容
addCompetitionContent: `competition/competition/content/addCompetitionContent`, addCompetitionContent: `competition/competition/content/addCompetitionContent`,

@ -207,6 +207,7 @@ export default {
playingStages: [] playingStages: []
}, },
timer: null, timer: null,
redisTimer: null,
pickerOptions: { pickerOptions: {
shortcuts: [{ shortcuts: [{
text: '此刻', text: '此刻',
@ -247,6 +248,7 @@ export default {
this.getData() this.getData()
this.$once('hook:beforeDestroy', function() { this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer) clearInterval(this.timer)
clearInterval(this.redisTimer)
}) })
}, },
methods: { methods: {
@ -300,11 +302,21 @@ export default {
}, },
getData() { getData() {
this.getList() this.getList()
if (!Setting.isDev) {
clearInterval(this.redisTimer)
this.redisTimer = setInterval(this.getRedis, 1000)
}
}, },
initData() { initData() {
this.page = 1; this.page = 1;
this.getData(); this.getData();
}, },
// redis
getRedis() {
this.$post(this.api.getRedisCacheCompetition).then(({ data }) => {
data && this.getList()
}).catch(res => {})
},
add() { add() {
this.$router.push("/addMatch"); this.$router.push("/addMatch");
}, },

Loading…
Cancel
Save