back-end done

This commit is contained in:
Amir Mohamadi
2020-12-10 16:36:48 +03:30
parent 80a7abafb7
commit bc5e617778
92 changed files with 5217 additions and 3379 deletions
+4
View File
@@ -0,0 +1,4 @@
export default function ({$auth, redirect}) {
if ($auth.loggedIn && $auth.user.scope.includes('admin')) return true
else return redirect('/admin/login')
}
-17
View File
@@ -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'})
}
})
}
}