|
@ -7,13 +7,12 @@ import { remainingPaths } from "/@/router"; |
|
|
import { transformI18n } from "/@/plugins/i18n"; |
|
|
import { transformI18n } from "/@/plugins/i18n"; |
|
|
import { storageSession } from "/@/utils/storage"; |
|
|
import { storageSession } from "/@/utils/storage"; |
|
|
import { useAppStoreHook } from "/@/store/modules/app"; |
|
|
import { useAppStoreHook } from "/@/store/modules/app"; |
|
|
import { useUserStoreHook } from "/@/store/modules/user"; |
|
|
|
|
|
import { useEpThemeStoreHook } from "/@/store/modules/epTheme"; |
|
|
import { useEpThemeStoreHook } from "/@/store/modules/epTheme"; |
|
|
|
|
|
|
|
|
export function useNav() { |
|
|
export function useNav() { |
|
|
const pureApp = useAppStoreHook(); |
|
|
const pureApp = useAppStoreHook(); |
|
|
// 用户名
|
|
|
// 用户名
|
|
|
const usename: string = storageSession.getItem("info")?.username; |
|
|
|
|
|
|
|
|
const username: string = storageSession.getItem("info")?.username; |
|
|
|
|
|
|
|
|
// 设置国际化选中后的样式
|
|
|
// 设置国际化选中后的样式
|
|
|
const getDropdownItemStyle = computed(() => { |
|
|
const getDropdownItemStyle = computed(() => { |
|
@ -39,7 +38,8 @@ export function useNav() { |
|
|
|
|
|
|
|
|
// 退出登录
|
|
|
// 退出登录
|
|
|
function logout() { |
|
|
function logout() { |
|
|
useUserStoreHook().logOut(); |
|
|
|
|
|
|
|
|
storageSession.removeItem("info"); |
|
|
|
|
|
router.push("/login"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function backHome() { |
|
|
function backHome() { |
|
@ -112,7 +112,7 @@ export function useNav() { |
|
|
resolvePath, |
|
|
resolvePath, |
|
|
isCollapse, |
|
|
isCollapse, |
|
|
pureApp, |
|
|
pureApp, |
|
|
usename, |
|
|
|
|
|
|
|
|
username, |
|
|
getDropdownItemStyle |
|
|
getDropdownItemStyle |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |