Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +++
- change in laravel all routes /* that are not ajax to redirect to /
- +++
- import VueRouter from 'vue-router';
- import Tools from './tools';
- let routes = [{
- name:'main',
- path: '/',
- children:[
- {
- path:'home',
- meta:{dontShowToolbar:true},
- component: require('./components/Home.vue').default
- },
- {
- path:'forgotpw',
- meta:{dontShowToolbar:true,alreadyLogged:true},
- component: require('./components/pw_ctrl_components/ForgotPw.vue').default
- },
- {
- path:'resetpw',
- meta:{dontShowToolbar:true,alreadyLogged:true,NotOnForgot:true},
- component: require('./components/pw_ctrl_components/ResetPw.vue').default
- },
- {
- path: 'all-scans',
- meta:{dontShowToolbar:true,notLogged:true},
- component: require('./components/scans_schedule/AllScans.vue').default,
- },
- {
- path:'userlogin',
- meta:{dontShowToolbar:true,alreadyLogged:true},
- component: require('./components/user_interaction_components/userLogin.vue').default,
- },
- {
- path:'pricing',
- meta:{dontShowToolbar:true},
- component:require('./components/user_interaction_components/Pricing.vue').default,
- },
- {
- path:'userreg',
- meta:{dontShowToolbar:true,alreadyLogged:true},
- component: require('./components/user_interaction_components/userReg.vue').default,
- },
- {
- path:'contact',
- meta:{dontShowToolbar:true},
- component:require('./components/user_interaction_components/contactForm.vue').default
- },
- {
- path:'tools',
- meta:{dontShowToolbar:true},
- component:require('./components/Tools.vue').default
- }
- ],
- component: require('./components/Main').default
- },
- {
- path: '*',
- redirect:'/'
- }
- ]
- for(let prop in Tools)
- {
- let specificTools = Tools[prop];
- specificTools.forEach((tool)=>{
- routes[0].children.push({
- meta:tool.metaProp,
- path: tool.relPath,
- component: require('./components/tools/'+tool.componentName).default
- })
- })
- }
- export default new VueRouter({
- mode:'history',
- routes,
- linkActiveClass: 'is-active'
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement