| | |
| | | |
| | | /** 路由白名单 */ |
| | | const whiteList = ["/login"]; |
| | | const noLoginList = ["/index", "/register", "/registersucess"]; |
| | | const noLoginList = [ |
| | | "/index", |
| | | "/register", |
| | | "/registernav", |
| | | "/registersucess", |
| | | "/gonggaoDetail" |
| | | ]; |
| | | // const whiteList = []; |
| | | |
| | | const { VITE_HIDE_HOME } = import.meta.env; |
| | |
| | | } |
| | | } else { |
| | | if (to.path !== "/login") { |
| | | if (whiteList.indexOf(to.path) !== -1) { |
| | | if (noLoginList.indexOf(to.path) !== -1) { |
| | | next(); |
| | | } else { |
| | | removeToken(); |
| | | next({ path: "/login" }); |
| | | next({ path: "/index" }); |
| | | } |
| | | } else { |
| | | next(); |