学生视图

This commit is contained in:
2026-07-26 21:53:00 +08:00 Unverified
parent b39a57ebdf
commit dd1b752fa3
3 changed files with 961 additions and 10 deletions
-9
View File
@@ -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' }