fix(front): tabbar 首页直达角色工作台路径;路由与类型调整(music-room 欢迎页等)

Made-with: Cursor
This commit is contained in:
2026-04-26 17:09:42 +08:00
parent 31f071ff80
commit be211a2638
3 changed files with 16 additions and 4 deletions
+12 -2
View File
@@ -1,7 +1,7 @@
<template>
<router-view />
<van-tabbar route v-if="!hide_bottom_tab && user.enabled && user.is_registered && current_role && user.real_name" :before-change="tab_change_check">
<van-tabbar-item name="首页" replace to="/" icon="home-o">首页</van-tabbar-item>
<van-tabbar-item name="首页" replace :to="home_tab_path" icon="home-o">首页</van-tabbar-item>
<template v-if="is_student">
<van-tabbar-item name="课程" replace to="/clazz" icon="calendar-o">课程</van-tabbar-item>
<van-tabbar-item name="打卡" replace to="/daka" icon="completed-o">打卡</van-tabbar-item>
@@ -98,8 +98,18 @@ export default defineComponent({
const hide_bottom_tab = computed(() => getKey("hide_bottom_tab"))
const home_tab_path = computed(() => {
const role = store.currentRole
if (!role) return '/'
if (role === HtyBaseRoles.STUDENT) return '/student/home'
if (role === HtyBaseRoles.TEACHER) return '/teacher/home'
if (role === HtySuperRoles.ADMIN) return '/admin/teachers'
if (role === HtySuperRoles.TESTER) return '/tester'
if (role === HtySuperRoles.SUPERVISOR) return '/supervisor/subsidiaries'
return '/'
})
return {user, is_student, is_teacher, is_admin, is_tester, is_guest, current_role, loading, badge_props, tab_change_check, hide_bottom_tab}
return {user, is_student, is_teacher, is_admin, is_tester, is_guest, current_role, loading, badge_props, tab_change_check, hide_bottom_tab, home_tab_path}
}
});
</script>
+1 -2
View File
@@ -118,8 +118,7 @@ router.beforeEach(async (to, from , next) => {
let activeRoles = roles?.filter(r => r.role_status === HtyStates.ACTIVE)
if(activeRoles?.length === 1) {
chooseRole(activeRoles[0].role_key)
}
if (to.path !== '/') {
} else if (to.path !== '/') {
await router.replace('/')
}
}
+3
View File
@@ -630,6 +630,8 @@ export interface Clazz {
instance?: Clazz;
has_root?: boolean;
is_notified?: boolean;
/** 业务已结课:首次点名落库时间;未点名或未结课为 null */
completed_at?: string | Date | null;
course_sections?: import('@authcore/commons').MultiVals<CourseSection>;
}
@@ -653,6 +655,7 @@ export interface ClazzWithRepeat {
clz_jihuas?: import('@authcore/commons').MultiVals<Jihua>;
clz_is_delete?: boolean;
clz_is_repeat: boolean;
clz_completed_at?: string | Date | null;
re_id: string;
re_clazz_id: string;
re_start_from?: string | Date;