|
@ -31,7 +31,8 @@ routes.push({ |
|
|
|
|
|
|
|
|
const router = new Router({ |
|
|
const router = new Router({ |
|
|
mode: 'history', |
|
|
mode: 'history', |
|
|
routes: routes.flat() |
|
|
routes: routes.flat(), |
|
|
|
|
|
base: '/questionnaire' |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 解决路由在 push/replace 了相同地址报错的问题
|
|
|
// 解决路由在 push/replace 了相同地址报错的问题
|
|
@ -46,11 +47,11 @@ Router.prototype.replace = function replace(location) { |
|
|
|
|
|
|
|
|
router.beforeEach((to, from, next) => { |
|
|
router.beforeEach((to, from, next) => { |
|
|
NProgress.start() |
|
|
NProgress.start() |
|
|
|
|
|
|
|
|
if (to.meta.requireLogin) { |
|
|
if (to.meta.requireLogin) { |
|
|
if (to.query.token) { |
|
|
if (to.query.token) { |
|
|
console.log('ro.query', to.query) |
|
|
console.log('ro.query', to.query) |
|
|
|
|
|
|
|
|
localStorage.setItem('loginSource', 'epmet') |
|
|
localStorage.setItem('loginSource', 'epmet') |
|
|
localStorage.setItem('customerId', to.query.customerId) |
|
|
localStorage.setItem('customerId', to.query.customerId) |
|
|
store.dispatch('user/getUserInfo', to.query.token) |
|
|
store.dispatch('user/getUserInfo', to.query.token) |
|
|