Browse Source

Fix the routing problem of the user management module (#8251)

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

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

@ -18,14 +18,17 @@
import { useRouter } from 'vue-router'
import { logout } from '@/service/modules/logout'
import { useUserStore } from '@/store/user/user'
import { useMenuStore } from '@/store/menu/menu'
import type { Router } from 'vue-router'
import { DropdownOption } from 'naive-ui'
export function useDropDown() {
const router: Router = useRouter()
const userStore = useUserStore()
const menuStore = useMenuStore()
const handleSelect = (key: string | number, option: DropdownOption) => {
menuStore.setMenuKey('')
if (key === 'logout') {
useLogout()
} else if (key === 'password') {

3
dolphinscheduler-ui-next/src/layouts/content/index.tsx

@ -61,8 +61,7 @@ const Content = defineComponent({
const getSideMenu = (state: any) => {
const key = menuStore.getMenuKey
state.sideMenuOptions =
state.menuOptions.filter((menu: { key: string }) => menu.key === key)[0]
.children || []
state.menuOptions.filter((menu: { key: string }) => menu.key === key)[0]?.children || state.menuOptions
state.isShowSide = menuStore.getShowSideStatus
}

2
dolphinscheduler-ui-next/src/store/menu/menu.ts

@ -28,7 +28,7 @@ export const useMenuStore = defineStore({
persist: true,
getters: {
getMenuKey(): string {
return this.menuKey || 'home'
return this.menuKey
},
getShowSideStatus(): boolean {
return this.isShowSide || false

Loading…
Cancel
Save