Commit e4e2b36c authored by lei's avatar lei

fix:修复音频问题

parent 63039b5f
...@@ -68,9 +68,9 @@ VITE_STORAGE_PREFIX=SOY_ ...@@ -68,9 +68,9 @@ VITE_STORAGE_PREFIX=SOY_
# VITE_SERVICE_URL=http://192.168.2.16:9998 # VITE_SERVICE_URL=http://192.168.2.16:9998
## 开发环境(黄国安) ## 开发环境(黄国安)
VITE_VIDEO_URL=ws://192.168.2.14:9999 # VITE_VIDEO_URL=ws://192.168.2.14:9999
VITE_WEBSOCKET_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_SERVICE_URL=http://192.168.2.14:9998
# # 测试环境(测试机) # # 测试环境(测试机)
...@@ -79,9 +79,9 @@ 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_SERVICE_URL=http://192.168.3.226:9998
# 测试环境(运营部) # 测试环境(运营部)
# VITE_VIDEO_URL=ws://192.168.3.248:9999 VITE_VIDEO_URL=ws://192.168.3.248:9999
# VITE_WEBSOCKET_URL=ws://192.168.3.248:9999 VITE_WEBSOCKET_URL=ws://192.168.3.248:9996
# VITE_SERVICE_URL=http://192.168.3.248:9998 VITE_SERVICE_URL=http://192.168.3.248:9996
# # 华远正式环境(外网) # # 华远正式环境(外网)
# VITE_VIDEO_URL=ws://220.194.146.65:9999 # VITE_VIDEO_URL=ws://220.194.146.65:9999
......
...@@ -34,3 +34,4 @@ yarn.lock ...@@ -34,3 +34,4 @@ yarn.lock
.VSCodeCounter .VSCodeCounter
*.rar *.rar
*.zip
...@@ -45,14 +45,14 @@ axios.interceptors.request.use( ...@@ -45,14 +45,14 @@ axios.interceptors.request.use(
axios.interceptors.response.use( axios.interceptors.response.use(
(res) => { (res) => {
if (res.status === 401) { if (res.status === 401) {
location.href = "http://yj.hylgzl.com/login"; // 山西华远大屏 // location.href = "http://yj.hylgzl.com/login"; // 山西华远大屏
// window.location.href = '/login' // window.location.href = '/login'
} }
return res; return res;
}, },
(e) => { (e) => {
// window.location.href = '/login' // window.location.href = '/login'
window.location.href = "http://yj.hylgzl.com/login"; // window.location.href = "http://yj.hylgzl.com/login";
}, },
); );
......
...@@ -81,21 +81,15 @@ const htmlStr = ref(''); ...@@ -81,21 +81,15 @@ const htmlStr = ref('');
const audioId = ref(''); const audioId = ref('');
const playAudio = async (id: string) => { const playAudio = async (id: string) => {
/** // 创建新的音频元素并播放
* 1. 接口形式并非准确的资源形式形式 const audio = new Audio(`${apiUrl}/v1/play/${id}`);
* 2. 模板的形式, 特殊处理 audio.play();
* 3. 动态js网络链接不上
*/ // 保留原始逻辑备用
// htmlStr.value = `<audio id="aWrap" controls autoplay>
// <source src="${apiUrl}/v1/play/${id}" type="audio/mpeg">
htmlStr.value = `<audio ref="audioE" id="aWrap" controls> // </audio>`;
<source id="audio" src="${apiUrl}/v1/play/${id}" type="audio/mpeg"></source> // nextTick(() => document.getElementById('aWrap')?.play());
</audio>`;
nextTick(() => {
let a = document.getElementById('aWrap');
a?.play();
});
}; };
const cId = ref(''); const cId = ref('');
...@@ -302,7 +296,7 @@ onMounted(() => { ...@@ -302,7 +296,7 @@ onMounted(() => {
window.$notification?.create({ window.$notification?.create({
duration: 5000, duration: 5000,
title: () => <div> title: () => <div>
<NSpace justify='space-between'> <NSpace justify='space-between' >
<NSpace align='center' > <NSpace align='center' >
{ {
data.algorithmGrade === 0 ? ( data.algorithmGrade === 0 ? (
...@@ -468,7 +462,7 @@ onMounted(() => { ...@@ -468,7 +462,7 @@ onMounted(() => {
</NModal> </NModal>
<!-- =================================== 弹窗 | E --> <!-- =================================== 弹窗 | 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"> <NSpace vertical :size="16">
<NModal v-model:show="showTipModal"> <NModal v-model:show="showTipModal">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment