Browse Source

修改wss,摄像头地址等问题

wangqin
刘朋 9 months ago
parent
commit
2d171db9f0
  1. 12
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js
  2. 3
      ruoyi-ui/src/views/websocket.vue
  3. 1
      ruoyi-ui/vue.config.js

12
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js

@ -9,14 +9,20 @@ import request from "@/utils/request";
* @param {1 | 2 | 3} media 参数说明: 1: http+flv; 2: rtmp; 3: hls * @param {1 | 2 | 3} media 参数说明: 1: http+flv; 2: rtmp; 3: hls
* @returns * @returns
*/ */
export function getCameraStream(camId, media = 1) { export async function getCameraStream(camId, media = 1) {
return request({ let data = await request({
url: "/video/externalVideoStreaming", url: "/video/externalVideoStreaming",
method: "get", method: "get",
params: { params: {
camId, camId,
}, },
}); });
if (data.code == 200){
data.data.liveUrl = "https://10.0.81.202/camera?target=" + data.data.liveUrl.substring(7);
}
return data;
} }
/** /**
@ -276,7 +282,7 @@ export function getEventTopicList(eventType) {
request({ request({
url: `/business/trafficIncidents/getEventList/${eventType}`, url: `/business/trafficIncidents/getEventList/${eventType}`,
method: "get", method: "post",
}) })
.then(({ code, data }) => { .then(({ code, data }) => {
if (code != 200) { if (code != 200) {

3
ruoyi-ui/src/views/websocket.vue

@ -30,7 +30,8 @@ export default {
// console.log(location.hostname ) // console.log(location.hostname )
// websocket // websocket
this.socket.initialize({ this.socket.initialize({
url: 'ws://' + location.hostname + ':' + port + path, // url: 'ws://' + location.hostname + ':' + port + path,
url: 'wss://' + location.hostname + ':' + window.location.port || 80 + '/ws',
// url: "ws://10.7.179.15" + ":" + port + path, // url: "ws://10.7.179.15" + ":" + port + path,
// url: "ws://10.168.64.171" + ":" + port + path, // url: "ws://10.168.64.171" + ":" + port + path,
// url: 'ws://10.168.78.127'+ ':' + port + path, // url: 'ws://10.168.78.127'+ ':' + port + path,

1
ruoyi-ui/vue.config.js

@ -31,6 +31,7 @@ module.exports = {
devServer: { devServer: {
host: "0.0.0.0", host: "0.0.0.0",
port: port, port: port,
https: true,
open: true, open: true,
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy

Loading…
Cancel
Save