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: '/' }) @@ -32,6 +36,7 @@ next() } } } } else { //判断是否需要认证,没有登录访问去登录页 if (meta.isAuth === false) {