diff --git a/resources/assets/js/components/RightBottom.vue b/resources/assets/js/components/RightBottom.vue index 692dfcea9..5714ebb03 100644 --- a/resources/assets/js/components/RightBottom.vue +++ b/resources/assets/js/components/RightBottom.vue @@ -16,17 +16,21 @@ -
-
{{$L('发现新版本')}}
- v{{systemVersion}} -> v{{updateVersion}} +
+
+
{{$L('发现新版本')}}
+ v{{systemVersion}} -> v{{updateVersion}} +
+
{{$L('离最新版本只有一步之遥了!重新启动应用即可完成更新。')}}
+
+ + +
@@ -59,9 +63,16 @@ export default { mounted() { this.checkVersion() // - this.subscribe = Store.subscribe('updateNotification', _ => { - this.updateShow = true - }) + if (this.$Electron) { + this.subscribe = Store.subscribe('updateNotification', _ => { + this.updateShow = true + }) + this.$Electron.registerMsgListener('updateDownloaded', info => { + this.updateVersion = info.version; + this.updateNote = info.releaseNotes || this.$L('没有更新描述。'); + this.updateShow = true; + }) + } }, beforeDestroy() { @@ -92,11 +103,6 @@ export default { this.apiVersion = data.version || '' if (this.$Electron) { // 客户端提示更新 - this.$Electron.registerMsgListener('updateDownloaded', info => { - this.updateVersion = info.version; - this.updateNote = info.releaseNotes || this.$L('没有更新描述。'); - this.updateShow = true; - }) this.$Electron.sendMessage('updateCheckAndDownload', { apiVersion: this.apiVersion }) @@ -107,7 +113,10 @@ export default { } }).catch(_ => { - }); + }) + // + this.__checkVersion && clearTimeout(this.__checkVersion) + this.__checkVersion = setTimeout(this.checkVersion, 600 * 1000) }, getDownloadUrl(publish) { @@ -126,7 +135,6 @@ export default { let timeout = 600; if (cache.time && cache.time + timeout > Math.round(new Date().getTime() / 1000)) { this.downloadUrl = cache.data.html_url; - setTimeout(this.checkVersion, timeout * 1000) return; } // @@ -142,10 +150,8 @@ export default { $A.setStorage(key, cache); this.downloadUrl = cache.data.html_url; } - setTimeout(this.checkVersion, timeout * 1000) }).catch(() => { this.loadIng--; - setTimeout(this.checkVersion, timeout * 1000) }); break; } diff --git a/resources/assets/sass/components/right-bottom.scss b/resources/assets/sass/components/right-bottom.scss index e05991b6f..1c9adacd6 100644 --- a/resources/assets/sass/components/right-bottom.scss +++ b/resources/assets/sass/components/right-bottom.scss @@ -28,6 +28,9 @@ } .common-right-bottom-notification { + .ivu-modal-header { + padding-bottom: 8px !important; + } .notification-head { display: flex; align-items: center; @@ -70,6 +73,13 @@ } } } + .notification-tip { + display: inline-block; + color: #999999; + line-height: 22px; + padding-top: 4px; + font-size: 12px; + } .notification-link { margin-top: 20px; text-align: right;