From c2650ef5e820465de448eb800057709d03c42b49 Mon Sep 17 00:00:00 2001 From: labbomb <739955946@qq.com> Date: Thu, 3 Mar 2022 15:12:18 +0800 Subject: [PATCH] [Fix][UI Next][V1.0.0-Alpha] Fix menu selection status display error (#8677) --- .../src/layouts/content/components/user/use-dropdown.ts | 1 - dolphinscheduler-ui-next/src/views/login/use-login.ts | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-ui-next/src/layouts/content/components/user/use-dropdown.ts b/dolphinscheduler-ui-next/src/layouts/content/components/user/use-dropdown.ts index 123669b71a..c65fde47f5 100644 --- a/dolphinscheduler-ui-next/src/layouts/content/components/user/use-dropdown.ts +++ b/dolphinscheduler-ui-next/src/layouts/content/components/user/use-dropdown.ts @@ -28,7 +28,6 @@ export function useDropDown() { const menuStore = useMenuStore() const handleSelect = (key: string | number, unused: DropdownOption) => { - menuStore.setMenuKey('') if (key === 'logout') { useLogout() } else if (key === 'password') { diff --git a/dolphinscheduler-ui-next/src/views/login/use-login.ts b/dolphinscheduler-ui-next/src/views/login/use-login.ts index e560e3dee3..6e8a50e541 100644 --- a/dolphinscheduler-ui-next/src/views/login/use-login.ts +++ b/dolphinscheduler-ui-next/src/views/login/use-login.ts @@ -22,10 +22,12 @@ import { useUserStore } from '@/store/user/user' import type { Router } from 'vue-router' import type { SessionIdRes } from '@/service/modules/login/types' import type { UserInfoRes } from '@/service/modules/users/types' +import { useMenuStore } from '@/store/menu/menu' export function useLogin(state: any) { const router: Router = useRouter() const userStore = useUserStore() + const menuStore = useMenuStore() const handleLogin = () => { state.loginFormRef.validate(async (valid: any) => { @@ -36,7 +38,9 @@ export function useLogin(state: any) { const userInfoRes: UserInfoRes = await getUserInfo() await userStore.setUserInfo(userInfoRes) - router.push({ path: 'home' }) + const key = menuStore.getMenuKey + + router.push({ path: key || 'home' }) } }) }