From e757a1973729eb3cf3b692c969bdd52f88f7c6e2 Mon Sep 17 00:00:00 2001 From: jmal Date: Mon, 29 Jan 2024 16:34:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Navbar.vue | 17 +++++++++++++--- src/layout/components/Sidebar/SidebarItem.vue | 20 +++++++++++++++---- src/store/getters.js | 1 + src/store/modules/user.js | 11 +++++++++- src/views/setting/cloudManager.vue | 16 ++++++++++++++- src/websocket/sockJS.js | 16 +++++++-------- 6 files changed, 64 insertions(+), 17 deletions(-) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 9f54af1..382e6de 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -17,6 +17,7 @@
{{showName}}
+
@@ -29,6 +30,7 @@ :to="resolvePath(route.path)" > + {{route.children[0].name}} @@ -39,7 +41,6 @@
-
@@ -51,7 +52,6 @@ import Breadcrumb from '@/components/Breadcrumb' import Hamburger from '@/components/Hamburger' import Icon from '@/components/Icon/Icon.vue' import AppLink from './Sidebar/Link' -import store from "@/store" import {isExternal} from "@/utils/validate"; import path from "path"; @@ -74,7 +74,8 @@ export default { ...mapGetters([ 'sidebar', 'avatar', - 'showName' + 'showName', + 'newVersion' ]), routes() { let routes = {} @@ -120,6 +121,16 @@ export default { diff --git a/src/store/getters.js b/src/store/getters.js index 9b196ba..a93fcbc 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -6,6 +6,7 @@ const getters = { avatar: state => state.user.avatar, name: state => state.user.name, showName: state => state.user.showName, + newVersion: state => state.user.newVersion, userId: state => state.user.userId, userInfo: state => state.user.userInfo, menuList: state => state.user.menuList, diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 8529d29..f0f502d 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -35,6 +35,7 @@ const getDefaultState = () => { menuList: [], netdiskName: '', netdiskLogo: '', + newVersion: '' } } @@ -73,6 +74,9 @@ const mutations = { }, SET_NETDISK_LOGO:(state,netdiskLogo) => { state.netdiskLogo = netdiskLogo; + }, + SET_NEW_VERSION:(state,newVersion) => { + state.newVersion = newVersion; } } @@ -148,7 +152,7 @@ const actions = { // reject('Verification failed, please Login again.') } - const { id, username, showName, avatar, netdiskName, netdiskLogo} = data + const { id, username, showName, avatar, netdiskName, netdiskLogo, newVersion} = data commit('SET_NAME', username) commit('SET_SHOW_NAME', showName) @@ -157,6 +161,11 @@ const actions = { commit('SET_USER_INFO', data) commit('SET_NETDISK_NAME', netdiskName) commit('SET_NETDISK_LOGO', netdiskLogo) + if (newVersion) { + commit('SET_NEW_VERSION', newVersion) + } else { + commit('SET_NEW_VERSION', '') + } setLogo(netdiskName, netdiskLogo) sessionStorage.setItem('store', JSON.stringify(state)) resolve(data) diff --git a/src/views/setting/cloudManager.vue b/src/views/setting/cloudManager.vue index 0d512b5..89faf76 100644 --- a/src/views/setting/cloudManager.vue +++ b/src/views/setting/cloudManager.vue @@ -43,7 +43,7 @@ 将图片转换为webp格式存储,在不降低图片质量的情况下,极大降低图片文件的体积,建议开启. 什么是webp? -
网盘同步: +
重建索引: @@ -56,6 +56,14 @@
一般用于初始化角色、菜单数据 + +
当前版本:v{{currentVersion}} + +
+ 最新版本:{{newVersion ? newVersion : 'v' + currentVersion}} + 在github上更新 + +
@@ -122,6 +130,7 @@