1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 23:11:24 +08:00

Fixed token to large error

This commit is contained in:
2023-05-23 02:29:36 +08:00
parent f87df23ea1
commit bd44024c29
7 changed files with 40 additions and 28 deletions

View File

@@ -50,7 +50,7 @@ const router = createRouter({
]
})
router.beforeEach((to, from, next) => {
router.beforeEach(async (to, from, next) => {
if (to.matched.length === 0) {
from.path !== '' ? next({ path: from.path }) : next('/')
} else {
@@ -64,7 +64,7 @@ router.beforeEach((to, from, next) => {
next('/')
} else {
if (to.meta.requiresAuth === true) {
const user = getUser()
const user = await getUser()
const menus = user.menus
for (const menu of menus) {
if (menu.url === '/') continue