From 9b0c0a0f4f85cb12af1d76be242e15dda1a35ad0 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 6 Apr 2023 17:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E4=BA=8B=E5=AE=9A=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/setting.js | 2 +- src/utils/api.js | 1 + src/views/match/list/index.vue | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) 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"); },