Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
AI推理平台
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lichunliang
AI推理平台
Commits
e4e2b36c
Commit
e4e2b36c
authored
Apr 11, 2025
by
lei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复音频问题
parent
63039b5f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
25 deletions
+20
-25
.env
.env
+6
-6
.gitignore
.gitignore
+1
-0
index.ts
src/api/index.ts
+2
-2
index.vue
src/views/home/index.vue
+11
-17
No files found.
.env
View file @
e4e2b36c
...
...
@@ -68,9 +68,9 @@ VITE_STORAGE_PREFIX=SOY_
# VITE_SERVICE_URL=http://192.168.2.16:9998
## 开发环境(黄国安)
VITE_VIDEO_URL=ws://192.168.2.14:9999
VITE_WEBSOCKET_URL=ws://192.168.2.14:9999
VITE_SERVICE_URL=http://192.168.2.14:9998
#
VITE_VIDEO_URL=ws://192.168.2.14:9999
#
VITE_WEBSOCKET_URL=ws://192.168.2.14:9999
#
VITE_SERVICE_URL=http://192.168.2.14:9998
# # 测试环境(测试机)
...
...
@@ -79,9 +79,9 @@ VITE_SERVICE_URL=http://192.168.2.14:9998
# VITE_SERVICE_URL=http://192.168.3.226:9998
# 测试环境(运营部)
#
VITE_VIDEO_URL=ws://192.168.3.248:9999
# VITE_WEBSOCKET_URL=ws://192.168.3.248:9999
# VITE_SERVICE_URL=http://192.168.3.248:9998
VITE_VIDEO_URL=ws://192.168.3.248:9999
VITE_WEBSOCKET_URL=ws://192.168.3.248:9996
VITE_SERVICE_URL=http://192.168.3.248:9996
# # 华远正式环境(外网)
# VITE_VIDEO_URL=ws://220.194.146.65:9999
...
...
.gitignore
View file @
e4e2b36c
...
...
@@ -34,3 +34,4 @@ yarn.lock
.VSCodeCounter
*.rar
*.zip
src/api/index.ts
View file @
e4e2b36c
...
...
@@ -45,14 +45,14 @@ axios.interceptors.request.use(
axios
.
interceptors
.
response
.
use
(
(
res
)
=>
{
if
(
res
.
status
===
401
)
{
location
.
href
=
"
http://yj.hylgzl.com/login
"
;
// 山西华远大屏
//
location.href = "http://yj.hylgzl.com/login"; // 山西华远大屏
// window.location.href = '/login'
}
return
res
;
},
(
e
)
=>
{
// window.location.href = '/login'
window
.
location
.
href
=
"
http://yj.hylgzl.com/login
"
;
//
window.location.href = "http://yj.hylgzl.com/login";
},
);
...
...
src/views/home/index.vue
View file @
e4e2b36c
...
...
@@ -81,21 +81,15 @@ const htmlStr = ref('');
const
audioId
=
ref
(
''
);
const
playAudio
=
async
(
id
:
string
)
=>
{
/**
* 1. 接口形式并非准确的资源形式形式
* 2. 模板的形式, 特殊处理
* 3. 动态js网络链接不上
*/
htmlStr
.
value
=
`<audio ref="audioE" id="aWrap" controls>
<source id="audio" src="
${
apiUrl
}
/v1/play/
${
id
}
" type="audio/mpeg"></source>
</audio>`
;
nextTick
(()
=>
{
let
a
=
document
.
getElementById
(
'
aWrap
'
);
a
?.
play
();
});
// 创建新的音频元素并播放
const
audio
=
new
Audio
(
`
${
apiUrl
}
/v1/play/
${
id
}
`
);
audio
.
play
();
// 保留原始逻辑备用
// htmlStr.value = `
<
audio
id
=
"
aWrap
"
controls
autoplay
>
//
<
source
src
=
"
${apiUrl}/v1/play/${id}
"
type
=
"
audio/mpeg
"
>
//
<
/audio>`
;
// nextTick(() => document.getElementById('aWrap')?.play());
};
const
cId
=
ref
(
''
);
...
...
@@ -302,7 +296,7 @@ onMounted(() => {
window
.
$notification
?.
create
({
duration
:
5000
,
title
:
()
=>
<
div
>
<
NSpace
justify
=
'
space-between
'
>
<
NSpace
justify
=
'
space-between
'
>
<
NSpace
align
=
'
center
'
>
{
data
.
algorithmGrade
===
0
?
(
...
...
@@ -468,7 +462,7 @@ onMounted(() => {
</NModal>
<!-- =================================== 弹窗 | E -->
<
div
style=
"border: 1px solid red; position: fixed; top: -1000px"
v-html=
"htmlStr"
></div
>
<
!-- <div style="border: 1px solid red; position: fixed; top: -1000px" v-html="htmlStr"></div> --
>
<NSpace
vertical
:size=
"16"
>
<NModal
v-model:show=
"showTipModal"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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