mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-04 13:17:50 +08:00
Fix the routing problem of the user management module (#8251)
This commit is contained in:
parent
49d581d72e
commit
c160bfba9a
@ -18,14 +18,17 @@
|
|||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { logout } from '@/service/modules/logout'
|
import { logout } from '@/service/modules/logout'
|
||||||
import { useUserStore } from '@/store/user/user'
|
import { useUserStore } from '@/store/user/user'
|
||||||
|
import { useMenuStore } from '@/store/menu/menu'
|
||||||
import type { Router } from 'vue-router'
|
import type { Router } from 'vue-router'
|
||||||
import { DropdownOption } from 'naive-ui'
|
import { DropdownOption } from 'naive-ui'
|
||||||
|
|
||||||
export function useDropDown() {
|
export function useDropDown() {
|
||||||
const router: Router = useRouter()
|
const router: Router = useRouter()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
const menuStore = useMenuStore()
|
||||||
|
|
||||||
const handleSelect = (key: string | number, option: DropdownOption) => {
|
const handleSelect = (key: string | number, option: DropdownOption) => {
|
||||||
|
menuStore.setMenuKey('')
|
||||||
if (key === 'logout') {
|
if (key === 'logout') {
|
||||||
useLogout()
|
useLogout()
|
||||||
} else if (key === 'password') {
|
} else if (key === 'password') {
|
||||||
|
@ -61,8 +61,7 @@ const Content = defineComponent({
|
|||||||
const getSideMenu = (state: any) => {
|
const getSideMenu = (state: any) => {
|
||||||
const key = menuStore.getMenuKey
|
const key = menuStore.getMenuKey
|
||||||
state.sideMenuOptions =
|
state.sideMenuOptions =
|
||||||
state.menuOptions.filter((menu: { key: string }) => menu.key === key)[0]
|
state.menuOptions.filter((menu: { key: string }) => menu.key === key)[0]?.children || state.menuOptions
|
||||||
.children || []
|
|
||||||
state.isShowSide = menuStore.getShowSideStatus
|
state.isShowSide = menuStore.getShowSideStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ export const useMenuStore = defineStore({
|
|||||||
persist: true,
|
persist: true,
|
||||||
getters: {
|
getters: {
|
||||||
getMenuKey(): string {
|
getMenuKey(): string {
|
||||||
return this.menuKey || 'home'
|
return this.menuKey
|
||||||
},
|
},
|
||||||
getShowSideStatus(): boolean {
|
getShowSideStatus(): boolean {
|
||||||
return this.isShowSide || false
|
return this.isShowSide || false
|
||||||
|
Loading…
Reference in New Issue
Block a user