feat(shared): update db schema, i18n messages, rate-limit, auth-session-provider

- Update src/shared/db/schema.ts

- Update i18n messages for en and zh-CN (error-book, exam-homework, leave,

  lesson-preparation, notifications, rbac, student, textbooks, diagnostic)

- Update src/shared/lib/rate-limit/index.ts and redis-limiter.ts

- Update src/shared/components/auth-session-provider.tsx
This commit is contained in:
SpecialX
2026-07-04 10:23:29 +08:00
parent 3569d83b8e
commit d2c250a1b3
21 changed files with 848 additions and 331 deletions

View File

@@ -27,7 +27,12 @@
"unpublishPlanConfirm": "撤回后学生和家长将无法查看此课案,确认撤回?",
"publishPlanSuccess": "课案已发布",
"unpublishPlanSuccess": "课案已撤回",
"viewHomework": "查看"
"viewHomework": "查看",
"undo": "撤销",
"undoShortcut": "撤销 (Ctrl+Z)",
"redo": "重做",
"redoShortcut": "重做 (Ctrl+Shift+Z)",
"scheduleLesson": "安排课时"
},
"status": {
"saving": "保存中...",
@@ -39,7 +44,15 @@
"published": "已发布",
"rejected": "已驳回",
"archived": "已归档",
"publishedAsHomework": "已发布为作业"
"publishedAsHomework": "已发布为作业",
"retrySave": "重试保存",
"saveFailed": "保存失败",
"saveFailedHint": "请检查网络后重试,编辑内容已保留",
"recovered": "已恢复保存",
"offline": "网络已断开",
"offlineHint": "编辑内容会保留在本地,恢复网络后自动保存",
"offlineBadge": "离线",
"backOnline": "网络已恢复"
},
"blockType": {
"objective": "教学目标",
@@ -130,7 +143,46 @@
"textbookLabel": "教材",
"chapterLabel": "课文",
"selectNodeForAnchor": "选择要关联的节点",
"createNewNode": "创建新节点并关联"
"createNewNode": "创建新节点并关联",
"autoLayout": "自动布局",
"autoLayoutHint": "按流程关系自动排列节点",
"stageLabel": "阶段",
"stageNone": "未归类",
"stage": {
"import": "导入",
"new_teaching": "新授",
"consolidation": "巩固",
"summary": "总结"
},
"differentiationLabel": "差异化",
"differentiationNone": "无",
"differentiation": {
"basic": "基础",
"intermediate": "提高",
"advanced": "拓展"
},
"consistencyTitle": "教学评一致性",
"consistencyScore": "一致性分数:{score}",
"consistencyCoverage": "目标覆盖:{covered}/{total}",
"consistencyOpen": "一致性校验",
"consistencyClose": "关闭",
"consistencyNoIssues": "未发现一致性问题",
"consistencyObjectiveCount": "目标 {count}",
"consistencyExerciseCount": "评价 {count}"
},
"consistency": {
"title": "教学评一致性校验",
"score": "一致性分数:{score}",
"coverage": "目标覆盖:{covered}/{total}",
"noIssues": "未发现一致性问题",
"code": {
"noObjective": "缺少教学目标节点(建议添加 objective 节点)",
"noExercise": "缺少评价节点(建议添加 exercise 节点)",
"objectiveNotAssessed": "目标「{title}」未被任何评价覆盖",
"exerciseNoKnowledgePoint": "评价「{title}」未关联任何知识点",
"exerciseWithoutObjective": "评价「{title}」未关联任何教学目标",
"objectiveNoKnowledgePoint": "目标「{title}」未标注知识点"
}
},
"readonly": {
"title": "查看课案",
@@ -160,6 +212,65 @@
"title": "年级备课",
"description": "查看本年级教师的备课"
},
"library": {
"title": "校内课案库",
"description": "浏览本校教师分享的优秀课案",
"empty": "暂无可参考的课案",
"fork": "复制为我的课案",
"forkSuccess": "已复制到我的课案",
"byCreator": "作者:{creator}",
"noCreator": "未知作者"
},
"feedback": {
"title": "AI 教学反馈",
"open": "AI 反馈",
"loading": "AI 正在分析课案...",
"loadFailed": "AI 反馈生成失败,请稍后重试",
"empty": "未生成反馈建议",
"summary": "整体评估",
"score": "评分",
"category": {
"strengths": "优点",
"improvements": "改进建议",
"alignment": "教学评一致性",
"differentiation": "差异化建议"
}
},
"aiDifferentiation": {
"title": "AI 差异化与课标核对",
"open": "AI 差异化",
"loading": "AI 正在分析...",
"loadFailed": "AI 分析失败,请稍后重试",
"empty": "未生成结果",
"noKnowledgePoints": "未提供知识点列表,无法进行课标核对",
"covered": "已覆盖 {count} 项",
"missed": "未覆盖 {count} 项",
"tabs": {
"differentiation": "差异化建议",
"curriculum": "课标核对",
"assessment": "可解释评估"
},
"level": {
"basic": "基础层",
"intermediate": "提高层",
"advanced": "拓展层"
}
},
"heatmap": {
"title": "课标覆盖热力图",
"description": "查看您所有课案对教材知识点的覆盖情况",
"totalKps": "知识点总数",
"coveredKps": "已覆盖",
"coverageRate": "覆盖率",
"blindSpotTitle": "{count} 个教学盲点",
"andMore": " 等",
"unknownChapter": "未知章节",
"chapterCoverage": "{covered}/{total}{rate}%",
"notCovered": "未覆盖",
"planCount": "{count} 个课案",
"selectTextbook": "请选择教材查看热力图",
"noData": "该教材暂无知识点数据"
},
"picker": {
"textbookLabel": "选择教材",
"chapterLabel": "选择课文",
@@ -172,7 +283,11 @@
"noChapters": "该教材暂无章节",
"selectedChapter": "已选课文:{chapter}",
"skeletonHint": "将自动生成以课文正文为核心的备课骨架(含 10 个教学节点)",
"errorTextbookChapterRequired": "请选择教材和课文"
"errorTextbookChapterRequired": "请选择教材和课文",
"searchTextbookPlaceholder": "搜索教材(标题/学科/年级)...",
"searchTextbookLabel": "搜索教材",
"recentSection": "最近使用",
"searchEmpty": "无匹配教材"
},
"filters": {
"searchPlaceholder": "搜索标题...",
@@ -203,6 +318,25 @@
"autoLabel": "自动版本",
"revertLabel": "回退到 v{versionNo}"
},
"diff": {
"summary": "新增 {added} · 删除 {removed} · 修改 {modified}",
"comparing": "对比 v{version} 与当前",
"noChanges": "两个版本内容一致,无差异",
"unchangedCount": "{count} 个节点未变更",
"added": "新增",
"removed": "删除",
"modified": "修改",
"unchanged": "未变",
"changedFields": "变更字段",
"compareWithCurrent": "对比当前",
"back": "返回",
"field": {
"title": "标题",
"stage": "阶段",
"differentiation": "差异化",
"data": "内容"
}
},
"knowledgePoint": {
"title": "选择知识点",
"empty": "未找到知识点,请先在教材模块创建",
@@ -232,6 +366,10 @@
"questionId": "题目 {id}",
"type": {
"single_choice": "单选题",
"multiple_choice": "多选题",
"true_false": "判断题",
"short_answer": "简答题",
"essay": "论述题",
"text": "填空题",
"judgment": "判断题"
},
@@ -246,7 +384,8 @@
"difficultyLabel": "难度",
"knowledgePointLabel": "知识点",
"stemRequired": "请输入题干",
"addBtn": "添加"
"addBtn": "添加",
"noDetail": "(无详细内容)"
},
"exercise": {
"purposeLabel": "用途",
@@ -271,7 +410,27 @@
"planNotFound": "课案不存在",
"noPermission": "无权发布",
"homeworkTitle": "{title} - 作业",
"homeworkDescription": "来自课案"
"homeworkDescription": "来自课案",
"step1": "选择班级",
"step2": "预览作业",
"step3": "确认发布",
"stepIndicator": "第 {current}/{total} 步:{label}",
"next": "下一步",
"back": "上一步",
"previewClassCount": "下发班级数",
"previewQuestionCount": "题目数量",
"previewTotalScore": "总分",
"previewQuestionList": "题目列表",
"previewSource": "来源:{source}",
"previewNoStem": "(无题干预览)",
"previewScore": "{score} 分",
"confirmTitle": "请确认发布信息",
"confirmClassCount": "下发班级数:{count}",
"confirmQuestionCount": "题目数量:{count}",
"confirmTotalScore": "总分:{score}",
"confirmAvailableAt": "开始时间:{time}",
"confirmDueAt": "截止时间:{time}",
"confirmWarning": "发布后学生和家长将立即收到作业,请仔细核对。"
},
"textStudy": {
"sourceTextLabel": "课文原文",
@@ -336,7 +495,12 @@
"text": "文字式"
},
"contentLabel": "板书内容",
"contentPlaceholder": "输入板书内容..."
"contentPlaceholder": "输入板书内容...",
"editMode": "编辑",
"previewMode": "预览",
"editHint": "提示:使用 2 个空格或 1 个 Tab 缩进表示层级",
"previewEmpty": "暂无内容,请切换到编辑模式输入",
"untitled": "中心主题"
},
"import": {
"hint": "设计课堂导入环节",
@@ -365,6 +529,45 @@
"richText": {
"placeholder": "输入内容..."
},
"export": {
"title": "导出/打印",
"button": "导出",
"print": "打印",
"variantDetailed": "详细版",
"variantConcise": "简洁版",
"teacher": "教师",
"class": "班级",
"totalDuration": "教学时长 {count} 分钟",
"lastSavedAt": "最后保存",
"empty": "课案无内容",
"emptySection": "(无内容)",
"footerHint": "教案导出 - {variant}"
},
"attachment": {
"title": "素材库",
"add": "上传文件",
"insert": "插入附件",
"libraryLabel": "本课案已上传附件",
"empty": "暂无附件,请先上传",
"delete": "删除",
"remove": "移除",
"embeddedCount": "已嵌入 {count} 个附件",
"createSuccess": "附件已添加",
"deleteSuccess": "附件已删除",
"uploadFailed": "上传失败",
"uploadSuccess": "上传成功",
"type": {
"reference": "参考资料",
"material": "教学素材",
"supplementary": "补充资源"
},
"kind": {
"image": "图片",
"audio": "音频",
"video": "视频",
"file": "文件"
}
},
"error": {
"getList": "获取课案列表失败",
"getOne": "获取课案失败",
@@ -394,7 +597,12 @@
"titleTooLong": "标题不能超过 255 个字符",
"templateRequired": "请选择模板",
"invalidDate": "日期格式无效",
"classRequired": "至少选择一个班级"
"classRequired": "至少选择一个班级",
"invalidInput": "输入数据无效",
"unauthorized": "未授权操作",
"planIdRequired": "课案 ID 必填",
"classIdRequired": "班级 ID 必填",
"dateRequired": "日期必填"
},
"confirm": {
"archive": "确认归档此课案?",
@@ -506,22 +714,6 @@
"updateSuccess": "已更新",
"deleteSuccess": "已删除"
},
"attachment": {
"title": "资源附件",
"add": "添加附件",
"empty": "暂无附件",
"type": {
"reference": "参考资料",
"material": "教学素材",
"supplementary": "补充材料"
},
"nameLabel": "名称",
"urlLabel": "链接",
"typeLabel": "类型",
"createSuccess": "附件已添加",
"deleteSuccess": "附件已删除",
"updateSuccess": "附件已更新"
},
"substitute": {
"title": "代课教师",
"add": "添加代课",
@@ -540,6 +732,24 @@
"deleteSuccess": "代课已删除",
"cancelConfirm": "确认取消此代课安排?"
},
"schedule": {
"title": "安排课时",
"boundList": "已绑定课时",
"empty": "暂无绑定课时",
"addNew": "添加新绑定",
"classLabel": "班级",
"dateLabel": "日期",
"periodLabel": "节次",
"durationLabel": "时长(分钟)",
"period": "第{n}节",
"duration": "{n}分钟",
"add": "添加",
"delete": "删除",
"selectClass": "请选择班级",
"selectDate": "请选择日期",
"addSuccess": "已添加课时绑定",
"deleteSuccess": "已删除课时绑定"
},
"evaluation": {
"title": "AI 课案评估",
"run": "开始评估",