邓洁 : 修复bug

This commit is contained in:
dengj
2023-12-29 16:57:29 +08:00
parent 101f200a96
commit 8289274d52
4 changed files with 38 additions and 32 deletions

View File

@@ -60,7 +60,7 @@ const routes = [
}
},
{
path: '/tunnel/:siteId(\\d+)/:type/:userId(\\d+)',
path: '/tunnel/:siteId/:type/:userId',
name: 'tunnel',
component: () => import('@/views/tunnel-manage/index.vue'),
meta: {
@@ -85,6 +85,7 @@ const router = createRouter({
});
router.beforeEach((to, form, next) => {
NProgress.start()
console.log('token-----',getToken())
if (!getToken()) {
if (to.path === '/login') {
next()
@@ -94,12 +95,12 @@ router.beforeEach((to, form, next) => {
}
} else {
console.log('有token')
if (to.path === '/login') {
next('/')
NProgress.done()
} else {
// if (to.path === '/login') {
// next('/')
// NProgress.done()
// } else {
next()
}
// }
}
})
router.afterEach(() => {