lzq 2026-03-06 12:18:27 +08:00
parent 4bddd5b24f
commit f648363d31
2 changed files with 4 additions and 24 deletions

View File

@ -60,8 +60,7 @@ const router = function () {
router.beforeEach((to, from) => {
const appUserStore = useAppUserStore()
const name = <string>to.name
const name = to.name as string
// 已登录
if (appUserStore.isAuthenticated) {
if (from.path === '/' && router.getRoutes().length <= 4) {// 浏览器刷新
@ -87,26 +86,6 @@ router.beforeEach((to, from) => {
return false
}
})
/* const succ = reloadRouter()
if (!succ
&& SpecialPage.Login !== name
&& SpecialPage.Home !== name
&& SpecialPage.Main !== name
&& SpecialPage.NotFound !== name) {
return {
replace: true,
name: SpecialPage.Home,
}
} else {
let routeName = router.getRoutes().find((it) => it.path === to.path)?.name as string
if (Strings.isBlank(routeName)) {
routeName = SpecialPage.Home
}
setTimeout(() => {
Evt.emit('browserReflash', routeName)
})
return false
} */
}
return true
}

View File

@ -5,7 +5,6 @@
// ------
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
import { GlobalComponents } from 'vue'
export {}
@ -59,6 +58,7 @@ declare module 'vue' {
ElText: typeof import('element-plus/es')['ElText']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTransfer: typeof import('element-plus/es')['ElTransfer']
ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload']
RouterLink: typeof import('vue-router')['RouterLink']
@ -118,8 +118,9 @@ declare global {
const ElText: typeof import('element-plus/es')['ElText']
const ElTooltip: typeof import('element-plus/es')['ElTooltip']
const ElTransfer: typeof import('element-plus/es')['ElTransfer']
const ElTree: typeof import('element-plus/es')['ElTree']
const ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
const ElUpload: typeof import('element-plus/es')['ElUpload']
const RouterLink: typeof import('vue-router')['RouterLink']
const RouterView: typeof import('vue-router')['RouterView']
}
}