Browse Source

[Fix][UI Next][V1.0.0-Alpha] Fix menu selection status display error (#8677)

3.0.0/version-upgrade
labbomb 3 years ago committed by GitHub
parent
commit
c2650ef5e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      dolphinscheduler-ui-next/src/layouts/content/components/user/use-dropdown.ts
  2. 6
      dolphinscheduler-ui-next/src/views/login/use-login.ts

1
dolphinscheduler-ui-next/src/layouts/content/components/user/use-dropdown.ts

@ -28,7 +28,6 @@ export function useDropDown() {
const menuStore = useMenuStore() const menuStore = useMenuStore()
const handleSelect = (key: string | number, unused: DropdownOption) => { const handleSelect = (key: string | number, unused: DropdownOption) => {
menuStore.setMenuKey('')
if (key === 'logout') { if (key === 'logout') {
useLogout() useLogout()
} else if (key === 'password') { } else if (key === 'password') {

6
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 { Router } from 'vue-router'
import type { SessionIdRes } from '@/service/modules/login/types' import type { SessionIdRes } from '@/service/modules/login/types'
import type { UserInfoRes } from '@/service/modules/users/types' import type { UserInfoRes } from '@/service/modules/users/types'
import { useMenuStore } from '@/store/menu/menu'
export function useLogin(state: any) { export function useLogin(state: any) {
const router: Router = useRouter() const router: Router = useRouter()
const userStore = useUserStore() const userStore = useUserStore()
const menuStore = useMenuStore()
const handleLogin = () => { const handleLogin = () => {
state.loginFormRef.validate(async (valid: any) => { state.loginFormRef.validate(async (valid: any) => {
@ -36,7 +38,9 @@ export function useLogin(state: any) {
const userInfoRes: UserInfoRes = await getUserInfo() const userInfoRes: UserInfoRes = await getUserInfo()
await userStore.setUserInfo(userInfoRes) await userStore.setUserInfo(userInfoRes)
router.push({ path: 'home' }) const key = menuStore.getMenuKey
router.push({ path: key || 'home' })
} }
}) })
} }

Loading…
Cancel
Save