feat: 增加班级id
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled

This commit is contained in:
阿梦 2026-05-14 16:17:21 +08:00
parent ffacb4d300
commit 055ff4c0d1
4 changed files with 40 additions and 12 deletions

View File

@ -150,6 +150,31 @@ class ClassroomMonitorService {
`/school/classMonitor/heartbeat?classId=${encodeURIComponent(String(classId))}`, `/school/classMonitor/heartbeat?classId=${encodeURIComponent(String(classId))}`,
) )
} }
/** 教师共享屏幕测试:开启 */
async startTeacherShareScreen(
classId: number | string,
ip: string,
port: number,
) {
return await post('/school/teacherScreenShare/startTeacherShareScreen', {
classId,
ip,
port,
})
}
/** 教师共享屏幕测试:结束 */
async stopTeacherShareScreen(classId: number | string) {
return await post('/school/teacherScreenShare/stopTeacherShareScreen', {
classId,
})
}
/** 教师共享屏幕测试:心跳(建议每 60 秒) */
async teacherShareScreenHeartbeat(classId: number | string) {
return await post('/school/teacherScreenShare/heartbeat', { classId })
}
} }
export const classroomMonitorService = new ClassroomMonitorService() export const classroomMonitorService = new ClassroomMonitorService()

View File

@ -8,15 +8,17 @@ interface Window {
teacherApi?: { teacherApi?: {
startSfu: () => Promise<{ port: number; already?: boolean }> startSfu: () => Promise<{ port: number; already?: boolean }>
stopSfu: () => Promise<void> stopSfu: () => Promise<void>
/** 可选传入班级学员列表与班级名称;名称用于教师端共享窗口标题「{名称} - 屏幕共享」。 */ /** 可选传入班级学员列表、班级名称与班级 id;名称用于教师端共享窗口标题「{名称} - 屏幕共享」id 用于教师端业务与心跳。 */
openScreenShareWindow: ( openScreenShareWindow: (
classStudentRows?: unknown[], classStudentRows?: unknown[],
className?: string, className?: string,
classId?: string | number,
) => Promise<void> ) => Promise<void>
/** 打开学员屏幕监控独立窗口teacher-electron */ /** 打开学员屏幕监控独立窗口teacher-electron;名称用于窗口标题,班级 id 下发至监控页。 */
openStudentScreenMonitorWindow?: ( openStudentScreenMonitorWindow?: (
classStudentRows?: unknown[], classStudentRows?: unknown[],
className?: string, className?: string,
classId?: string | number,
) => Promise<void> ) => Promise<void>
setShareClassStudentsListener?: ( setShareClassStudentsListener?: (
cb: ((rows: unknown[]) => void) | null, cb: ((rows: unknown[]) => void) | null,

View File

@ -45,6 +45,7 @@ const studentSnapshotPreviewList = computed(() => {
}) })
const SNAPSHOT_REFRESH_INTERVAL = 5000 const SNAPSHOT_REFRESH_INTERVAL = 5000
const MONITOR_HEARTBEAT_INTERVAL = 60 * 1000 const MONITOR_HEARTBEAT_INTERVAL = 60 * 1000
let snapshotRefreshTimer: ReturnType<typeof setInterval> | undefined let snapshotRefreshTimer: ReturnType<typeof setInterval> | undefined
let heartbeatTimer: ReturnType<typeof setInterval> | undefined let heartbeatTimer: ReturnType<typeof setInterval> | undefined
@ -273,10 +274,10 @@ async function openTeacherScreenShareWindow(item: ClassroomItem) {
classId: item.id, classId: item.id,
}) })
const rows = (page as any)?.data?.rows ?? page?.rows ?? [] const rows = (page as any)?.data?.rows ?? page?.rows ?? []
await api.openScreenShareWindow(rows, item.name ?? '') await api.openScreenShareWindow(rows, item.name ?? '', item.id)
} catch (e) { } catch (error) {
console.error(e) console.error(error)
throw e throw error
} }
}, },
error: async () => { error: async () => {
@ -300,10 +301,10 @@ async function openStudentScreenMonitorWindow(item: ClassroomItem) {
classId: item.id, classId: item.id,
}) })
const rows = (page as any)?.data?.rows ?? page?.rows ?? [] const rows = (page as any)?.data?.rows ?? page?.rows ?? []
await openMon(rows, item.name ?? '') await openMon(rows, item.name ?? '', item.id)
} catch (e) { } catch (error) {
console.error(e) console.error(error)
throw e throw error
} }
}, },
error: async () => { error: async () => {

View File

@ -33,8 +33,8 @@ export default defineConfig(async () => {
open: true, open: true,
proxy: { proxy: {
'/api': { '/api': {
target: 'http://43.136.52.196:9053', // target: 'http://43.136.52.196:9053',
// target: 'https://admin.lingxixue.com', target: 'https://tiku.lingxixue.com',
changeOrigin: true, changeOrigin: true,
}, },
}, },