feat:支持教师端检查更新
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
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:
parent
51531fa49a
commit
43c14e2e02
@ -105,6 +105,14 @@ const setupAccessGuard = (router: Router) => {
|
|||||||
accessStore.setAccessMenus(accessibleMenus)
|
accessStore.setAccessMenus(accessibleMenus)
|
||||||
accessStore.setAccessRoutes(accessibleRoutes)
|
accessStore.setAccessRoutes(accessibleRoutes)
|
||||||
accessStore.setIsAccessChecked(true)
|
accessStore.setIsAccessChecked(true)
|
||||||
|
|
||||||
|
const teacherToken = accessStore.accessToken?.trim()
|
||||||
|
if (teacherToken && window.teacherApi?.setToken) {
|
||||||
|
void window.teacherApi.setToken(teacherToken).catch((error) => {
|
||||||
|
console.warn('[guard] sync accessToken to teacher client failed', error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
let redirectPath: string
|
let redirectPath: string
|
||||||
if (from.query.redirect) {
|
if (from.query.redirect) {
|
||||||
redirectPath = from.query.redirect as string
|
redirectPath = from.query.redirect as string
|
||||||
|
|||||||
5
playground/src/types/global.d.ts
vendored
5
playground/src/types/global.d.ts
vendored
@ -6,6 +6,8 @@ interface Window {
|
|||||||
unique: number
|
unique: number
|
||||||
/** teacher-electron 注入,仅在桌面客户端内嵌题库页时存在 */
|
/** teacher-electron 注入,仅在桌面客户端内嵌题库页时存在 */
|
||||||
teacherApi?: {
|
teacherApi?: {
|
||||||
|
/** 登录后将 accessToken 同步至教师端(纯 token,不含 `Bearer `)。 */
|
||||||
|
setToken?: (accessToken?: string | null) => Promise<void>
|
||||||
startSfu: () => Promise<{ port: number; already?: boolean }>
|
startSfu: () => Promise<{ port: number; already?: boolean }>
|
||||||
stopSfu: () => Promise<void>
|
stopSfu: () => Promise<void>
|
||||||
/** 可选传入班级学员列表、班级名称与班级 id;名称用于教师端共享窗口标题「{名称} - 屏幕共享」,id 用于教师端业务与心跳。 */
|
/** 可选传入班级学员列表、班级名称与班级 id;名称用于教师端共享窗口标题「{名称} - 屏幕共享」,id 用于教师端业务与心跳。 */
|
||||||
@ -13,15 +15,12 @@ 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,14 +9,12 @@ 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)
|
||||||
@ -276,12 +274,7 @@ 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
|
||||||
@ -308,12 +301,7 @@ 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
|
||||||
|
|||||||
@ -12,7 +12,11 @@ export default (event: anyObj): TableColumn[] => [
|
|||||||
width: 100,
|
width: 100,
|
||||||
render: (h, scope) => (
|
render: (h, scope) => (
|
||||||
<ElTag type={scope.row.updateType === 1 ? 'primary' : 'success'}>
|
<ElTag type={scope.row.updateType === 1 ? 'primary' : 'success'}>
|
||||||
{scope.row.updateType === 1 ? 'WEB' : 'APK'}
|
{scope.row.updateType === 1
|
||||||
|
? 'WEB'
|
||||||
|
: scope.row.updateType === 2
|
||||||
|
? 'APK'
|
||||||
|
: 'TEA'}
|
||||||
</ElTag>
|
</ElTag>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -12,7 +12,11 @@ export default (event: anyObj): TableColumn[] => [
|
|||||||
width: 100,
|
width: 100,
|
||||||
render: (h, scope) => (
|
render: (h, scope) => (
|
||||||
<ElTag type={scope.row.updateType === 1 ? 'primary' : 'success'}>
|
<ElTag type={scope.row.updateType === 1 ? 'primary' : 'success'}>
|
||||||
{scope.row.updateType === 1 ? 'WEB' : 'APK'}
|
{scope.row.updateType === 1
|
||||||
|
? 'WEB'
|
||||||
|
: scope.row.updateType === 2
|
||||||
|
? 'APK'
|
||||||
|
: 'TEA'}
|
||||||
</ElTag>
|
</ElTag>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -80,7 +80,7 @@ async function handleSave(formEl: FormInstance | undefined) {
|
|||||||
await formEl.validate()
|
await formEl.validate()
|
||||||
await addVersion({
|
await addVersion({
|
||||||
...form,
|
...form,
|
||||||
model: form.updateType === 1 ? undefined : form.model,
|
model: form.updateType === 2 ? form.model : undefined,
|
||||||
})
|
})
|
||||||
show.value = false
|
show.value = false
|
||||||
emit('onRefresh')
|
emit('onRefresh')
|
||||||
@ -110,6 +110,7 @@ async function handleSave(formEl: FormInstance | undefined) {
|
|||||||
<el-select v-model="form.updateType">
|
<el-select v-model="form.updateType">
|
||||||
<el-option label="WEB" :value="1" />
|
<el-option label="WEB" :value="1" />
|
||||||
<el-option label="APK" :value="2" />
|
<el-option label="APK" :value="2" />
|
||||||
|
<el-option label="TEA" :value="3" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<template v-if="form.updateType === 2">
|
<template v-if="form.updateType === 2">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user