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

bugfix

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