brotherton-erpnext/erpnext/public/js/education/lms/routes.js
2019-02-19 13:06:33 +05:30

40 lines
893 B
JavaScript

import Home from "./pages/Home.vue";
import ProgramPage from "./pages/ProgramPage.vue";
import ContentPage from "./pages/ContentPage.vue";
import ListPage from "./pages/ListPage.vue";
const routes = [
{name: 'home', path: '', component: Home},
{name: 'program', path: '/Program/:program_name', component: ProgramPage, props: true},
{
name: 'content',
path: '/Program/:program_name/:course/:type/:content',
component: ContentPage,
props: true,
beforeEnter: (to, from, next) => {
if(!lms.store.isLogin){
next({name: 'home'})
}
else {
next()
}
}
},
{
name: 'list',
path: '/List/:master',
component: ListPage,
props: true
},
{
name: 'signup',
path: '/Signup',
beforeEnter(to, from, next) {
window.location = window.location.origin.toString() +'/login#signup'
},
component: ListPage,
props: true
},
];
export default routes;