src/permission.js
@@ -2,7 +2,7 @@ * @Author: shuishen 1109946754@qq.com * @Date: 2024-10-30 17:03:57 * @LastEditors: shuishen 1109946754@qq.com * @LastEditTime: 2024-10-30 17:07:40 * @LastEditTime: 2024-12-16 19:35:12 * @FilePath: \bigScreen\src\permission.js * @Description: * @@ -22,6 +22,10 @@ const meta = to.meta || {} if (token) { if (!to.matched.length) { // 如果路由不存在 next({ path: '/' }) } else { if (to.path === '/login') { //如果登录成功访问登录页跳转到主页 next({ path: '/' }) @@ -30,6 +34,7 @@ next({ path: '/login' }) } else { next() } } } } else { @@ -45,3 +50,4 @@ router.afterEach(to => { })