Advertisement
k0mZ

Untitled

May 1st, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. +++
  2. change in laravel all routes /* that are not ajax to redirect to /
  3. +++
  4.  
  5.  
  6. import VueRouter from 'vue-router';
  7. import Tools from './tools';
  8.  
  9. let routes = [{
  10. name:'main',
  11. path: '/',
  12.  
  13. children:[
  14. {
  15. path:'home',
  16. meta:{dontShowToolbar:true},
  17. component: require('./components/Home.vue').default
  18. },
  19. {
  20. path:'forgotpw',
  21. meta:{dontShowToolbar:true,alreadyLogged:true},
  22. component: require('./components/pw_ctrl_components/ForgotPw.vue').default
  23. },
  24. {
  25. path:'resetpw',
  26. meta:{dontShowToolbar:true,alreadyLogged:true,NotOnForgot:true},
  27. component: require('./components/pw_ctrl_components/ResetPw.vue').default
  28. },
  29. {
  30. path: 'all-scans',
  31. meta:{dontShowToolbar:true,notLogged:true},
  32. component: require('./components/scans_schedule/AllScans.vue').default,
  33. },
  34. {
  35. path:'userlogin',
  36. meta:{dontShowToolbar:true,alreadyLogged:true},
  37. component: require('./components/user_interaction_components/userLogin.vue').default,
  38. },
  39. {
  40. path:'pricing',
  41. meta:{dontShowToolbar:true},
  42. component:require('./components/user_interaction_components/Pricing.vue').default,
  43. },
  44. {
  45. path:'userreg',
  46. meta:{dontShowToolbar:true,alreadyLogged:true},
  47. component: require('./components/user_interaction_components/userReg.vue').default,
  48. },
  49. {
  50. path:'contact',
  51. meta:{dontShowToolbar:true},
  52. component:require('./components/user_interaction_components/contactForm.vue').default
  53. },
  54. {
  55. path:'tools',
  56. meta:{dontShowToolbar:true},
  57. component:require('./components/Tools.vue').default
  58. }
  59. ],
  60. component: require('./components/Main').default
  61. },
  62. {
  63. path: '*',
  64. redirect:'/'
  65. }
  66. ]
  67.  
  68. for(let prop in Tools)
  69. {
  70. let specificTools = Tools[prop];
  71. specificTools.forEach((tool)=>{
  72. routes[0].children.push({
  73. meta:tool.metaProp,
  74. path: tool.relPath,
  75. component: require('./components/tools/'+tool.componentName).default
  76. })
  77. })
  78. }
  79.  
  80.  
  81. export default new VueRouter({
  82. mode:'history',
  83. routes,
  84. linkActiveClass: 'is-active'
  85. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement