This commit is contained in:
scmmishra 2018-11-26 11:59:12 +05:30 committed by Aditya Hase
parent cc755f6204
commit cbb7c7ff23
2 changed files with 10 additions and 3 deletions

View File

@ -38,12 +38,11 @@ export default {
name: "CourseCard",
data() {
return {
isLogin: lms.store.isLogin,
courseMeta: {}
}
},
mounted() {
if(this.isLogin) this.getCourseMeta().then(data => this.courseMeta = data)
this.getCourseMeta().then(data => this.courseMeta = data)
},
components: {
AButton
@ -65,6 +64,9 @@ export default {
else {
return " hidden"
}
},
isLogin() {
return lms.store.checkLogin()
}
},
methods: {

View File

@ -12,7 +12,12 @@ const routes = [
component: ContentPage,
props: true,
beforeEnter: (to, from, next) => {
if(!lms.store.isLogin) next({name: 'home'})
if(!lms.store.isLogin){
next({name: 'home'})
}
else {
next()
}
}
},
{