Commit f3f20b82 authored by 张牧越's avatar 张牧越

bugfix

parent e7939cdb
NODE_ENV = "development" NODE_ENV = "development"
Mock: true Mock: true
VUE_APP_API_URL = "http://qjwl.ythplan.com/" VUE_APP_API_URL = "http://www.ythplat.com:8002/"
...@@ -204,6 +204,13 @@ export function getDeviceTodayChart(deviceId) { ...@@ -204,6 +204,13 @@ export function getDeviceTodayChart(deviceId) {
}) })
} }
export function getTowerLiveUrl(cameraId) {
return request({
url: `/pweb/s/towercrane/camera/liveaddress/${cameraId}`,
method: 'get',
})
}
//noise //noise
......
...@@ -55,10 +55,7 @@ ...@@ -55,10 +55,7 @@
<div class="status-text">数据更新</div> <div class="status-text">数据更新</div>
</div> </div>
</div> </div>
<div <div id="video-container" v-if="deviceData.camera_id"></div>
id="video-container"
v-if="deviceData.camera_live_address_url"
></div>
<div id="video-container-img" v-else> <div id="video-container-img" v-else>
<img :src="deviceData.image_url" alt="" /> <img :src="deviceData.image_url" alt="" />
</div> </div>
...@@ -74,7 +71,7 @@ ...@@ -74,7 +71,7 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { getDeviceTodayChart } from "@/api/index"; import { getDeviceTodayChart, getTowerLiveUrl } from "@/api/index";
require("vue-video-player/node_modules/video.js/dist/video-js.css"); require("vue-video-player/node_modules/video.js/dist/video-js.css");
import videojs from "video.js"; import videojs from "video.js";
import "videojs-contrib-hls"; import "videojs-contrib-hls";
...@@ -182,6 +179,7 @@ export default { ...@@ -182,6 +179,7 @@ export default {
}); });
}, },
openedEvents() { openedEvents() {
getTowerLiveUrl(this.deviceData.camera_id).then((res) => {
const myVideoDiv = document.getElementById(`video-container`); const myVideoDiv = document.getElementById(`video-container`);
myVideoDiv.innerHTML = `<video myVideoDiv.innerHTML = `<video
id="singleVideo" id="singleVideo"
...@@ -195,7 +193,7 @@ export default { ...@@ -195,7 +193,7 @@ export default {
loop: true, //是否循环播放 loop: true, //是否循环播放
}); });
singlePlayer.src({ singlePlayer.src({
src: this.deviceData.camera_live_address_url, src: res.data.live_address_url,
type: "application/x-mpegURL", type: "application/x-mpegURL",
}); });
singlePlayer.play(); singlePlayer.play();
...@@ -206,6 +204,7 @@ export default { ...@@ -206,6 +204,7 @@ export default {
this.renderTodayChart(); this.renderTodayChart();
}); });
}); });
});
}, },
}, },
computed: { computed: {
......
...@@ -64,7 +64,7 @@ request.interceptors.response.use( ...@@ -64,7 +64,7 @@ request.interceptors.response.use(
}) })
} }
if (response.data.status == 401) { if (response.data.status == 401) {
window.location.href = process.env.VUE_APP_API_URL + 'pweb/m/login?is_screen=1' // window.location.href = process.env.VUE_APP_API_URL + 'pweb/m/login?is_screen=1'
} }
return response.data return response.data
}, },
......
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