back-end done
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
export default function ({$auth, redirect}) {
|
||||
if ($auth.loggedIn && $auth.user.scope.includes('admin')) return true
|
||||
else return redirect('/admin/login')
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
export default function (ctx) {
|
||||
if (ctx.app.store.state.global.navigation_guard) {
|
||||
ctx.app.store.commit('global/navigationGuards', false)
|
||||
|
||||
/////////////////////////////////// beforeEach
|
||||
|
||||
|
||||
////////////////////////////////// afterEach
|
||||
ctx.app.router.afterEach((to, from) => {
|
||||
if (to.params.lang === 'fa') {
|
||||
$('html').attr({lang: 'fa'})
|
||||
} else if (to.params.lang === 'en') {
|
||||
$('html').attr({lang: 'en'})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user