ruoyi-ui/src/permission.js
@@ -9,7 +9,7 @@ NProgress.configure({ showSpinner: false }) const whiteList = ['/login', '/register'] const whiteList = ['/login', '/register','/anonymous/*'] const isWhiteList = (path) => { return whiteList.some(pattern => isPathMatch(pattern, path)) @@ -47,9 +47,11 @@ } } } else { debugger; // 没有token if (isWhiteList(to.path)) { if (isWhiteList(to.path) || to.meta.anonymous) { // 在免登录白名单,直接进入 next() } else { next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页