fix(teacher): 独立刷新老师目录以缩短配置更新延迟

This commit is contained in:
brother7 committed 2026-09-29 12:03:06 +08:00
1 parent 2767a15017
commit 913ccad577
9 files changed
+184 -7

No files matched your search

+5
View File
@@ -73,6 +73,11 @@ export const teacherAvailability = (account: TeacherAccount) =>
teacherCloudRequest<TeacherAvailability>(account, '/api/coding-teacher/config');
export const teacherCatalog = (account: TeacherAccount) =>
teacherCloudRequest<TeacherCatalog>(account, '/api/coding-teacher/teachers');
export async function teacherCatalogRevision(): Promise<{ revision: number }> {
const binding = getWorksSquareAccountBinding();
if (!binding) throw new TeacherError(401, 'teacher_auth_required', '请先登录。');
return teacherCloudRequest({ id: '', binding }, '/api/coding-teacher/teachers/revision');
}
export const teacherVersion = (account: TeacherAccount, version: number) =>
teacherCloudRequest<{ version: number; payload: TeacherDefinition }>(
account,
+5
View File
@@ -24,6 +24,7 @@ import {
teacherVersion,
teacherPreview,
teacherCatalog,
teacherCatalogRevision,
TeacherError,
type TeacherAccount,
} from './config-client';
@@ -103,6 +104,10 @@ export class CodingTeacherService {
async catalog() {
return (this.options.catalog ?? teacherCatalog)(await this.account());
}
async catalogRevision() {
return teacherCatalogRevision();
}
async legacyHistory(projectId: string, selection?: { id: string; sourceId: string; friend: boolean }) {
const account = await this.account();
const project = await this.options.projects.getProject(projectId);