router.beforeEach((to, from, next) => {
if (to.name === 'index' || to.name === 'register' || to.name === 'aboutUs' || to.name === 'noviceOnRoad' || to.name === 'findPassword' || to.name === 'agreement' || to.name === 'bindEmailSuccess' || to.name === 'changeEmailSuccess' || to.name === 'ddLogin') {
next();
} else {
if (Cookie.get('token')) {
next();
} else {
if (to.name === 'findPriceDetailInfo') {
Cookie.set('isRedirect', to.fullPath);
Message.error('请先登录!');
next('/index');
} else {
next('/index');
}
}
}
});