| | |
| | | router.beforeEach((to, from, next) => { |
| | | const meta = to.meta || {}; |
| | | const isMenu = meta.menu === undefined ? to.query.menu : meta.menu; |
| | | const redirect = decodeURIComponent(to.query.redirect || ''); |
| | | store.commit('SET_IS_MENU', isMenu === undefined); |
| | | if (getToken()) { |
| | | if (store.getters.isLock && to.path !== lockPage) { |
| | |
| | | } else if (to.path === '/login') { |
| | | //如果登录成功访问登录页跳转到主页 |
| | | next({ path: '/' }); |
| | | } else if (redirect){ |
| | | console.log('redirect',redirect); |
| | | next({ path: redirect}) |
| | | } else { |
| | | const systemToken = store.getters.token || urlParams?.token |
| | | if (systemToken === 0) { |