feat: 打开桌面端传token
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

This commit is contained in:
阿梦 2026-05-15 11:48:36 +08:00
parent 055ff4c0d1
commit 9707ec0c98
2 changed files with 17 additions and 2 deletions

View File

@ -13,12 +13,15 @@ interface Window {
classStudentRows?: unknown[],
className?: string,
classId?: string | number,
/** 管理端当前登录 accessToken供教师端主进程请求 teacherScreenShare 接口时带 Authorization */
accessToken?: string | null,
) => Promise<void>
/** 打开学员屏幕监控独立窗口teacher-electron名称用于窗口标题班级 id 下发至监控页。 */
openStudentScreenMonitorWindow?: (
classStudentRows?: unknown[],
className?: string,
classId?: string | number,
accessToken?: string | null,
) => Promise<void>
setShareClassStudentsListener?: (
cb: ((rows: unknown[]) => void) | null,

View File

@ -9,12 +9,14 @@ import type {
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
import { useRouter } from 'vue-router'
import { useAccessStore } from '@vben/stores'
import { classStudentService } from '../../../api/service/org/class-student'
import { classroomMonitorService } from '../../../api/service/org/classroom-monitor'
import hud from '../../../utils/hud'
const router = useRouter()
const accessStore = useAccessStore()
const classLoading = ref(false)
const detailLoading = ref(false)
@ -274,7 +276,12 @@ async function openTeacherScreenShareWindow(item: ClassroomItem) {
classId: item.id,
})
const rows = (page as any)?.data?.rows ?? page?.rows ?? []
await api.openScreenShareWindow(rows, item.name ?? '', item.id)
const token = accessStore.accessToken?.trim()
if (token) {
await api.openScreenShareWindow(rows, item.name ?? '', item.id, token)
} else {
await api.openScreenShareWindow(rows, item.name ?? '', item.id)
}
} catch (error) {
console.error(error)
throw error
@ -301,7 +308,12 @@ async function openStudentScreenMonitorWindow(item: ClassroomItem) {
classId: item.id,
})
const rows = (page as any)?.data?.rows ?? page?.rows ?? []
await openMon(rows, item.name ?? '', item.id)
const token = accessStore.accessToken?.trim()
if (token) {
await openMon(rows, item.name ?? '', item.id, token)
} else {
await openMon(rows, item.name ?? '', item.id)
}
} catch (error) {
console.error(error)
throw error