Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
dbc801a2
提交
dbc801a2
authored
8月 08, 2025
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: update app configuration and live monitor for improved user experience and functionality
上级
8b6f8dd9
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
23 行增加
和
13 行删除
+23
-13
useAppConfig.ts
src/composables/useAppConfig.ts
+1
-1
useLiveMonitor.ts
src/composables/useLiveMonitor.ts
+13
-9
Index.vue
src/modules/student/lab/views/Index.vue
+1
-1
index.ts
src/router/index.ts
+8
-2
没有找到文件。
src/composables/useAppConfig.ts
浏览文件 @
dbc801a2
...
...
@@ -14,7 +14,7 @@ const appConfigList = [
},
{
system
:
'x'
,
title
:
'1+X实训平台'
,
//
title: '1+X实训平台',
logo
:
'https://webapp-pub.ezijing.com/website/base/logo.svg'
,
hosts
:
[
'saas-x'
],
studentMenus
:
[
...
...
src/composables/useLiveMonitor.ts
浏览文件 @
dbc801a2
...
...
@@ -3,7 +3,7 @@ import { useLive, readBlobAsBase64 } from '@/composables/useLive'
import
{
useSocket
}
from
'@/composables/useSocket'
import
md5
from
'blueimp-md5'
import
{
ElMessageBox
}
from
'element-plus'
import
{
usePermission
}
from
'@vueuse/core'
import
{
usePermission
,
useIntervalFn
}
from
'@vueuse/core'
export
function
useLiveMonitor
({
autoStart
=
false
}:
{
autoStart
?:
boolean
}
=
{})
{
const
userStore
=
useUserStore
()
...
...
@@ -25,7 +25,7 @@ export function useLiveMonitor({ autoStart = false }: { autoStart?: boolean } =
},
})
const
{
st
ream
,
st
artTime
,
start
,
stop
,
restart
}
=
useLive
({
const
{
startTime
,
start
,
stop
,
restart
}
=
useLive
({
enabledUserMedia
:
autoStart
,
onRecord
:
async
(
blob
)
=>
{
const
base64Data
=
await
readBlobAsBase64
(
blob
)
...
...
@@ -40,23 +40,27 @@ export function useLiveMonitor({ autoStart = false }: { autoStart?: boolean } =
const
cameraPermission
=
usePermission
(
'camera'
)
const
hasMessageBox
=
ref
(
false
)
const
showMessageBox
=
()
=>
{
if
(
hasMessageBox
.
value
)
return
hasMessageBox
.
value
=
true
ElMessageBox
.
alert
(
'本次考试要求全程开启摄像头,请点击‘确定’允许摄像头访问,以便正常参加考试。'
,
'温馨提示'
,
{
confirmButtonText
:
'确定'
,
beforeClose
:
(
action
,
instance
,
done
)
=>
{
console
.
log
(
'stream'
,
stream
.
value
)
console
.
log
(
'cameraPermission'
,
cameraPermission
.
value
)
if
(
stream
.
value
&&
cameraPermission
.
value
===
'granted'
)
done
()
},
//
beforeClose: (action, instance, done) => {
//
console.log('stream', stream.value)
//
console.log('cameraPermission', cameraPermission.value)
//
if (stream.value && cameraPermission.value === 'granted') done()
//
},
callback
:
()
=>
{
hasMessageBox
.
value
=
false
restart
()
},
})
}
watchEffect
(()
=>
{
useIntervalFn
(()
=>
{
if
(
cameraPermission
.
value
===
'denied'
)
showMessageBox
()
})
}
,
1000
*
10
)
onMounted
(()
=>
{
if
(
autoStart
)
showMessageBox
()
...
...
src/modules/student/lab/views/Index.vue
浏览文件 @
dbc801a2
...
...
@@ -323,8 +323,8 @@ function handleGoToFunction(path: string) {
<
template
#
right
>
<AppCard>
<div
class=
"exam-status"
v-if=
"appConfig.system === 'x' && experimentInfo?.exam_status === 1"
>
<el-button
type=
"primary"
@
click=
"tabActive = 'qa'"
>
实操系统
</el-button>
<el-button
type=
"primary"
@
click=
"tabActive = 'exam'"
>
理论试题
</el-button>
<el-button
type=
"primary"
@
click=
"tabActive = 'qa'"
>
实操环境
</el-button>
</div>
<el-row
justify=
"space-between"
v-else
>
<div>
...
...
src/router/index.ts
浏览文件 @
dbc801a2
...
...
@@ -3,7 +3,7 @@ import { useUserStore } from '@/stores/user'
const
router
=
createRouter
({
history
:
createWebHistory
(),
routes
:
[{
path
:
'/:pathMatch(.*)*'
,
redirect
:
'/'
}]
routes
:
[{
path
:
'/:pathMatch(.*)*'
,
redirect
:
'/'
}]
,
})
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
...
...
@@ -18,7 +18,13 @@ router.beforeEach(async (to, from, next) => {
}
catch
(
e
)
{
console
.
error
(
e
)
}
user
.
isLogin
?
next
()
:
next
(
'/401'
)
if
(
!
user
.
isLogin
)
{
next
(
'/401'
)
return
}
}
if
(
to
.
path
===
'/'
&&
user
.
role
?.
id
===
1
)
{
next
(
'/student/lab'
)
return
}
next
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论