Commit e4e2b36c authored by lei's avatar lei

fix:修复音频问题

parent 63039b5f
......@@ -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
......
......@@ -34,3 +34,4 @@ yarn.lock
.VSCodeCounter
*.rar
*.zip
......@@ -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";
},
);
......
......@@ -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">
......
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