学生视图
This commit is contained in:
@@ -313,15 +313,6 @@ router.beforeEach((to) => {
|
||||
return { name: 'login', query: { redirect: to.fullPath } }
|
||||
}
|
||||
if (to.name === 'login' && auth.isLoggedIn) return { name: 'dashboard' }
|
||||
if (
|
||||
to.name === 'dashboard' &&
|
||||
auth.user?.roles.includes('Student') &&
|
||||
!auth.user.roles.some((role) =>
|
||||
['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin'].includes(role),
|
||||
)
|
||||
) {
|
||||
return { name: 'course-selections' }
|
||||
}
|
||||
const roles = to.meta.roles as string[] | undefined
|
||||
if (roles && !roles.some((role) => auth.user?.roles.includes(role))) {
|
||||
return { name: 'dashboard' }
|
||||
|
||||
Reference in New Issue
Block a user