- 后台课堂任务 admin/lesson → admin/task(/admin/task),和前台 oj/task 对上 - 后台首页 admin/setting/home.vue → admin/home/,设置 → admin/config/ - 卡点分析、年度趋势从 admin/problem 搬到 admin/analytics(/admin/analytics/stuck|trend),和菜单的「学情分析」、后端 analytics.ts 对上 - 首页 dashboard.vue / TeacherHome.vue → student.vue / teacher.vue;自学首页 home.vue → index.vue,看一课 index.vue → tutorial.vue - lesson 只表示课堂上的一节:自学那边改叫 tutorial(oj/learn/lesson.ts → utils.ts、isLessonDone → isTutorialDone、Lesson*.vue → Tutorial*.vue、自学情况的 lessons 字段 → tutorials) - 旧地址不留跳转 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
29c31640b5
commit
48590eee60
37 files changed
+1238
-1236
No files matched your search
@@ -4,23 +4,23 @@ import storage from 'utils/storage'
|
||||
import { useUserStore } from 'shared/store/user'
|
||||
|
||||
// 两边都按需加载:没登录的访客只拿题目列表那一份,登录了的学生只拿首页那一份
|
||||
const Dashboard = defineAsyncComponent(() => import('./dashboard.vue'))
|
||||
const StudentHome = defineAsyncComponent(() => import('./student.vue'))
|
||||
// 老师的首页单独一张(设计稿「首页重设计」HomeTeacher):今天哪些班在上课
|
||||
const TeacherHome = defineAsyncComponent(() => import('./TeacherHome.vue'))
|
||||
const TeacherHome = defineAsyncComponent(() => import('./teacher.vue'))
|
||||
const ProblemList = defineAsyncComponent(() => import('oj/problem/list.vue'))
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
// profile 回来之前先按上次的登录标记猜一个:干等的话 /profile 一失败首页就是
|
||||
// 白的,而先按「没登录」渲染又会让每个学生都先闪一下题目列表
|
||||
const showDashboard = computed(() => (userStore.isFinished ? userStore.isAuthed : !!storage.get(STORAGE_KEY.AUTHED)))
|
||||
const showHome = computed(() => (userStore.isFinished ? userStore.isAuthed : !!storage.get(STORAGE_KEY.AUTHED)))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<template v-if="showDashboard">
|
||||
<template v-if="showHome">
|
||||
<!-- 资料回来之前分不出是不是老师,先空着,免得老师先闪一下学生的首页 -->
|
||||
<TeacherHome v-if="userStore.isFinished && userStore.isTeacherOrAbove" />
|
||||
<Dashboard v-else-if="userStore.isFinished" />
|
||||
<StudentHome v-else-if="userStore.isFinished" />
|
||||
</template>
|
||||
<ProblemList v-else />
|
||||
</template>
|
||||
Reference in new issue
Block a user