diff --git a/src/setting.js b/src/setting.js index 9b97fde..2275aed 100644 --- a/src/setting.js +++ b/src/setting.js @@ -12,7 +12,7 @@ if (isDev) { host = 'http://121.37.12.51/' // host = 'https://huorantech.cn/' host = 'http://192.168.31.151:9000/'// 榕 - // host = 'http://192.168.31.116:9000/'// 赓 + // host = 'http://192.168.31.117:9000/'// 赓 } else if (isPro) { jumpPath = 'https://www.huorantech.cn/judgmentPoint/' } diff --git a/src/utils/api.js b/src/utils/api.js index e5bdfb7..f5967a8 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -312,6 +312,7 @@ export default { publishCompetition: `competition/competition/management/publishCompetition`, detailsOfCompetitionStage: `competition/competition/management/detailsOfCompetitionStage`, entryInformation: `competition/competition/team/entryInformation`, + getRedisCacheCompetition: `competition/competition/management/getRedisCache`, // 赛事内容 addCompetitionContent: `competition/competition/content/addCompetitionContent`, diff --git a/src/views/match/list/index.vue b/src/views/match/list/index.vue index 4b5d784..eb12580 100644 --- a/src/views/match/list/index.vue +++ b/src/views/match/list/index.vue @@ -207,6 +207,7 @@ export default { playingStages: [] }, timer: null, + redisTimer: null, pickerOptions: { shortcuts: [{ text: '此刻', @@ -247,6 +248,7 @@ export default { this.getData() this.$once('hook:beforeDestroy', function() { clearInterval(this.timer) + clearInterval(this.redisTimer) }) }, methods: { @@ -300,11 +302,21 @@ export default { }, getData() { this.getList() + if (!Setting.isDev) { + clearInterval(this.redisTimer) + this.redisTimer = setInterval(this.getRedis, 1000) + } }, initData() { this.page = 1; this.getData(); }, + // 获取redis缓存 + getRedis() { + this.$post(this.api.getRedisCacheCompetition).then(({ data }) => { + data && this.getList() + }).catch(res => {}) + }, add() { this.$router.push("/addMatch"); },