From 4e46148ba73b1591ea742cbe9e559cc632045ce6 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 22 Dec 2023 17:23:59 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=85=81=E8=AE=B8=E7=A4=BE=E5=8C=BA?= =?UTF-8?q?=E7=89=88=E4=BF=AE=E6=94=B9admin=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/layout/components/AccountOperator.vue | 18 +- core/core-frontend/src/router/index.ts | 16 ++ .../src/views/system/modify-pwd/UpdatePwd.vue | 140 +++++++++++++ .../src/views/system/modify-pwd/index.vue | 198 ++++++++++++++++++ de-xpack | 2 +- 5 files changed, 372 insertions(+), 2 deletions(-) create mode 100644 core/core-frontend/src/views/system/modify-pwd/UpdatePwd.vue create mode 100644 core/core-frontend/src/views/system/modify-pwd/index.vue diff --git a/core/core-frontend/src/layout/components/AccountOperator.vue b/core/core-frontend/src/layout/components/AccountOperator.vue index b46eb1e67f..13dcbc588f 100644 --- a/core/core-frontend/src/layout/components/AccountOperator.vue +++ b/core/core-frontend/src/layout/components/AccountOperator.vue @@ -10,6 +10,8 @@ import { useEmitt } from '@/hooks/web/useEmitt' import AboutPage from '@/views/about/index.vue' import LangSelector from './LangSelector.vue' import router from '@/router' +import { useCache } from '@/hooks/web/useCache' +const { wsCache } = useCache() const userStore = useUserStoreWithOut() const { t } = useI18n() @@ -30,6 +32,16 @@ const linkLoaded = items => { items.forEach(item => linkList.value.push(item)) linkList.value.sort(compare('id')) } +const xpackLinkLoaded = items => { + let len = linkList.value.length + while (len--) { + if (linkList.value[len]?.id === 2 && linkList.value[len]?.link === '/modify-pwd/index') { + linkList.value.splice(len, 1) + } + } + items.forEach(item => linkList.value.push(item)) + linkList.value.sort(compare('id')) +} const compare = (property: string) => { return (a, b) => a[property] - b[property] @@ -68,6 +80,10 @@ const openPopover = () => { if (uid.value === '1') { linkLoaded([{ id: 4, link: '/sys-setting/parameter', label: t('commons.system_setting') }]) + const desktop = wsCache.get('app.desktop') + if (!desktop) { + linkLoaded([{ id: 2, link: '/modify-pwd/index', label: t('user.change_password') }]) + } } @@ -138,7 +154,7 @@ if (uid.value === '1') { - + diff --git a/core/core-frontend/src/views/system/modify-pwd/index.vue b/core/core-frontend/src/views/system/modify-pwd/index.vue new file mode 100644 index 0000000000..8df082459f --- /dev/null +++ b/core/core-frontend/src/views/system/modify-pwd/index.vue @@ -0,0 +1,198 @@ + + + + diff --git a/de-xpack b/de-xpack index dfef649cb7..08ae0222ed 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit dfef649cb7d7d2490891ba7acb0ecfb342673a7b +Subproject commit 08ae0222ed43c0b19caab179e0ef5a96c4a69f94