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
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:
parent
055ff4c0d1
commit
9707ec0c98
3
playground/src/types/global.d.ts
vendored
3
playground/src/types/global.d.ts
vendored
@ -13,12 +13,15 @@ interface Window {
|
|||||||
classStudentRows?: unknown[],
|
classStudentRows?: unknown[],
|
||||||
className?: string,
|
className?: string,
|
||||||
classId?: string | number,
|
classId?: string | number,
|
||||||
|
/** 管理端当前登录 accessToken,供教师端主进程请求 teacherScreenShare 接口时带 Authorization */
|
||||||
|
accessToken?: string | null,
|
||||||
) => Promise<void>
|
) => Promise<void>
|
||||||
/** 打开学员屏幕监控独立窗口(teacher-electron);名称用于窗口标题,班级 id 下发至监控页。 */
|
/** 打开学员屏幕监控独立窗口(teacher-electron);名称用于窗口标题,班级 id 下发至监控页。 */
|
||||||
openStudentScreenMonitorWindow?: (
|
openStudentScreenMonitorWindow?: (
|
||||||
classStudentRows?: unknown[],
|
classStudentRows?: unknown[],
|
||||||
className?: string,
|
className?: string,
|
||||||
classId?: string | number,
|
classId?: string | number,
|
||||||
|
accessToken?: string | null,
|
||||||
) => Promise<void>
|
) => Promise<void>
|
||||||
setShareClassStudentsListener?: (
|
setShareClassStudentsListener?: (
|
||||||
cb: ((rows: unknown[]) => void) | null,
|
cb: ((rows: unknown[]) => void) | null,
|
||||||
|
|||||||
@ -9,12 +9,14 @@ import type {
|
|||||||
|
|
||||||
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import { useAccessStore } from '@vben/stores'
|
||||||
|
|
||||||
import { classStudentService } from '../../../api/service/org/class-student'
|
import { classStudentService } from '../../../api/service/org/class-student'
|
||||||
import { classroomMonitorService } from '../../../api/service/org/classroom-monitor'
|
import { classroomMonitorService } from '../../../api/service/org/classroom-monitor'
|
||||||
import hud from '../../../utils/hud'
|
import hud from '../../../utils/hud'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const accessStore = useAccessStore()
|
||||||
|
|
||||||
const classLoading = ref(false)
|
const classLoading = ref(false)
|
||||||
const detailLoading = ref(false)
|
const detailLoading = ref(false)
|
||||||
@ -274,7 +276,12 @@ 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 ?? []
|
||||||
|
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)
|
await api.openScreenShareWindow(rows, item.name ?? '', item.id)
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
throw error
|
throw error
|
||||||
@ -301,7 +308,12 @@ 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 ?? []
|
||||||
|
const token = accessStore.accessToken?.trim()
|
||||||
|
if (token) {
|
||||||
|
await openMon(rows, item.name ?? '', item.id, token)
|
||||||
|
} else {
|
||||||
await openMon(rows, item.name ?? '', item.id)
|
await openMon(rows, item.name ?? '', item.id)
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
throw error
|
throw error
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user