From 0eb78550f61642e2038b46e43331c009459a92b5 Mon Sep 17 00:00:00 2001 From: Next <1406099478@qq.com> Date: Mon, 16 Dec 2019 00:54:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A3=80=E6=9F=A5=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=BC=80=E5=85=B3=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 10 ++++++++++ js/app.js | 20 +++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index c4a9707..4aba1a3 100644 --- a/index.html +++ b/index.html @@ -175,6 +175,16 @@ + + + 检查版本 + + + + + + 源码 diff --git a/js/app.js b/js/app.js index 8b1215f..6a6e923 100644 --- a/js/app.js +++ b/js/app.js @@ -8,6 +8,7 @@ let app = new Vue({ isShowCache: false, isAutoRefreshTree: true, isDarkTheme: false, + isCheckVersion: false, filterText: '', splitLeft: 0.7, splitRight: 0.5, @@ -314,7 +315,7 @@ let app = new Vue({ }, false, true); } - let top = document.getElementById('top') + let top = document.getElementById('top'); top.appendChild(document.getElementsByClassName('toolbar')[0]); document.getElementById('game_panel').appendChild(document.getElementById('content')); let scene = cc.director.getScene(); @@ -386,6 +387,14 @@ let app = new Vue({ } }, + handleChangeCheckVersion(isCheckVersion) { + if (isCheckVersion) { + localStorage.setItem('isCheckVersion', '1'); + this.checkVersion(); + } else { + localStorage.setItem('isCheckVersion', '0'); + } + }, handleChangeTheme(isDark) { isDark ? this.addDarkTheme() : this.removeDarkTheme(); }, @@ -543,7 +552,6 @@ let app = new Vue({ } }, created: function () { - this.checkVersion(); document.body.insertBefore(document.getElementById('app'), document.body.firstChild); let onCCInit = () => { @@ -563,7 +571,13 @@ let app = new Vue({ } else { this.$data.isDarkTheme = false; } - this.$data.isShorProfile = localStorage.getItem('isShorProfile') === '1'; + if (localStorage.getItem('isCheckVersion') === '1') { + this.$data.isCheckVersion = true; + this.checkVersion(); + } else { + this.$data.isCheckVersion = false; + } + this.$data.isShowProfile = localStorage.getItem('isShowProfile') === '1'; setTimeout(() => { this.handleChangeStats(); }, 0);