Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
水玉婷
ai-wechat
Commits
00898816
Commit
00898816
authored
Mar 09, 2026
by
水玉婷
Browse files
feat:移除麦克风检查,并添加调试工具
parent
20c5890a
Changes
2
Hide whitespace changes
Inline
Side-by-side
index.html
View file @
00898816
...
...
@@ -11,5 +11,18 @@
<body>
<div
id=
"app"
></div>
<script
type=
"module"
src=
"/src/main.js"
></script>
<!-- 根据环境加载eruda.js -->
<script>
var
env
=
window
.
location
.
href
;
if
(
env
.
indexOf
(
'
//xc.cmic.com.cn
'
)
===
-
1
)
{
var
script
=
document
.
createElement
(
'
script
'
);
script
.
type
=
'
module
'
;
script
.
src
=
'
https://lib.baomitu.com/eruda/2.4.1/eruda.min.js
'
;
document
.
getElementsByTagName
(
'
head
'
)[
0
].
appendChild
(
script
);
script
.
onload
=
function
()
{
window
.
eruda
.
init
();
}
}
</script>
</body>
</html>
\ No newline at end of file
src/views/components/VoiceRecognitionText.vue
View file @
00898816
...
...
@@ -259,6 +259,7 @@ const isMediaRecorderSupported = () => {
const
checkMicrophonePermission
=
async
()
=>
{
try
{
const
permissionStatus
=
await
navigator
.
permissions
.
query
({
name
:
'
microphone
'
as
PermissionName
}
);
console
.
log
(
'
麦克风权限查询结果:
'
,
permissionStatus
);
if
(
props
.
debug
)
{
console
.
log
(
'
麦克风权限状态:
'
,
permissionStatus
.
state
);
...
...
@@ -282,12 +283,12 @@ const startRecording = async () => {
if
(
props
.
disabled
||
isRecording
.
value
||
!
isFullScreen
.
value
)
return
// 检查权限
const
hasPermission
=
await
checkMicrophonePermission
();
if
(
!
hasPermission
)
{
emit
(
'
error
'
,
'
麦克风权限被拒绝
'
);
exitFullScreen
();
return
;
}
//
const hasPermission = await checkMicrophonePermission();
//
if (!hasPermission)
{
//
emit('error', '麦克风权限被拒绝');
//
exitFullScreen();
//
return;
//
}
// 检查浏览器支持
if
(
!
isMediaRecorderSupported
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment