| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import Vue from 'vue';
- import Router from 'vue-router';
- Vue.use(Router);
- const routes = [
- {
- path: '/captcha/captcha',
- name: 'captcha',
- component: () => import('./view/captcha/captcha'),
- meta: {
- title: '获取验证码'
- }
- },
- {
- path: '*',
- name: 'login',
- component: () => import('./view/captcha/captcha'),
- meta: {
- title: '获取验证码'
- }
- },
- ];
- // add route path
- routes.forEach(route => {
- route.path = route.path || '/' + (route.name || '');
- });
- const router = new Router(
- {
- mode: 'history',
- routes
- });
- // const whiteList = [
- // 'login',
- // 'stafflogin',
- // 'invitation',
- // 'next',
- // 'join',
- // 'xiapu',
- // 'talentExchange',
- // 'captcha',
- // 'captchaLg',
- // ]
- router.beforeEach((to, from, next) => {
- const title = to.meta && to.meta.title;
- if (title) {
- document.title = title;
- }
- next()
- });
- export {
- router
- };
|