diff --git a/resources/assets/js/components/RightBottom.vue b/resources/assets/js/components/RightBottom.vue
index 165ac52dd..dcc9e9454 100644
--- a/resources/assets/js/components/RightBottom.vue
+++ b/resources/assets/js/components/RightBottom.vue
@@ -38,11 +38,17 @@ export default {
repoReleases: {},
downloadResult: {},
+
+ subscribe: null,
}
},
mounted() {
this.getReleases();
//
+ this.subscribe = Store.subscribe('releasesNotification', () => {
+ this.releasesNotification();
+ });
+ //
if (this.$Electron) {
this.$Electron.registerMsgListener('downloadDone', ({result}) => {
if (result.name == this.repoData.name && this.repoStatus !== 2) {
@@ -52,6 +58,12 @@ export default {
})
}
},
+ beforeDestroy() {
+ if (this.subscribe) {
+ this.subscribe.unsubscribe();
+ this.subscribe = null;
+ }
+ },
computed: {
...mapState([
'isDesktop',
@@ -203,6 +215,7 @@ export default {
releasesNotification() {
const {tag_name, body} = this.repoReleases;
+ this.$store.state.clientNewVersion = tag_name
$A.modalConfirm({
okText: this.$L('立即更新'),
onOk: () => {
diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue
index 9e4a2b71f..9016c03bc 100644
--- a/resources/assets/js/pages/manage.vue
+++ b/resources/assets/js/pages/manage.vue
@@ -11,7 +11,8 @@
{{userInfo.nickname}}
-
+
+
@@ -20,11 +21,13 @@
{{$L(item.name)}}
-
+
+
@@ -238,7 +241,6 @@ import DragBallComponent from "../components/DragBallComponent";
import TaskAdd from "./manage/components/TaskAdd";
import Report from "./manage/components/Report";
import {Store} from "le5le-store";
-import state from "../store/state";
export default {
components: {
@@ -342,7 +344,9 @@ export default {
'themeMode',
'themeList',
- 'wsMsg'
+ 'wsMsg',
+
+ 'clientNewVersion'
]),
...mapGetters(['taskData', 'dashboardTask']),
@@ -377,6 +381,7 @@ export default {
{path: 'password', name: '密码设置'},
{path: 'clearCache', name: '清除缓存'},
{path: 'system', name: '系统设置', divided: true},
+ {path: 'version', name: '更新版本', visible: !!this.clientNewVersion},
{path: 'workReport', name: '工作报告', divided: true},
{path: 'allUser', name: '团队管理'},
{path: 'allProject', name: '所有项目'},
@@ -387,6 +392,7 @@ export default {
{path: 'personal', name: '个人设置'},
{path: 'password', name: '密码设置'},
{path: 'clearCache', name: '清除缓存'},
+ {path: 'version', name: '更新版本', divided: true, visible: !!this.clientNewVersion},
{path: 'workReport', name: '工作报告', divided: true},
{path: 'archivedProject', name: '已归档的项目'}
]
@@ -546,6 +552,9 @@ export default {
}
this.workReportShow = true;
return;
+ case 'version':
+ Store.set('releasesNotification', null);
+ return;
case 'clearCache':
this.$store.dispatch("handleClearCache", null).then(() => {
$A.setStorage("clearCache", $A.randomString(6))
diff --git a/resources/assets/js/pages/manage/setting/index.vue b/resources/assets/js/pages/manage/setting/index.vue
index 0d804e465..19e2458a8 100644
--- a/resources/assets/js/pages/manage/setting/index.vue
+++ b/resources/assets/js/pages/manage/setting/index.vue
@@ -19,7 +19,16 @@
:key="key"
:class="classNameRoute(item.path, item.divided)"
@click="toggleRoute(item.path)">{{$L(item.name)}}
- {{$L('版本')}}: {{version}}
+
+ {{$L('版本')}}: {{version}}
+
+
+
+ {{$L('版本')}}: {{version}}
+
@@ -32,6 +41,7 @@