修复工作
This commit is contained in:
2
.env
2
.env
@@ -18,7 +18,7 @@ BACKEND_HOST=rtsp-backend
|
|||||||
BACKEND_PORT=8080
|
BACKEND_PORT=8080
|
||||||
|
|
||||||
# 前端服务配置
|
# 前端服务配置
|
||||||
FRONTEND_PORT=10080
|
FRONTEND_PORT=10081
|
||||||
|
|
||||||
# Python推理服务配置
|
# Python推理服务配置
|
||||||
PYTHON_SERVICE_HOST=rtsp-python-service
|
PYTHON_SERVICE_HOST=rtsp-python-service
|
||||||
|
|||||||
@@ -44,6 +44,29 @@ server {
|
|||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 视频流代理(HTTP-FLV)
|
||||||
|
location /live {
|
||||||
|
proxy_pass http://rtsp-backend:8866/live;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header Connection "";
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_cache off;
|
||||||
|
}
|
||||||
|
|
||||||
|
# 视频流代理(HLS)
|
||||||
|
location /hls {
|
||||||
|
proxy_pass http://rtsp-backend:8866/hls;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_cache off;
|
||||||
|
}
|
||||||
|
|
||||||
# MinIO使用外部服务,不需要代理
|
# MinIO使用外部服务,不需要代理
|
||||||
|
|
||||||
# 错误页面配置
|
# 错误页面配置
|
||||||
|
|||||||
@@ -68,7 +68,8 @@ onMounted(() => {
|
|||||||
const getDetails = async (deviceId) => {
|
const getDetails = async (deviceId) => {
|
||||||
const res = await getDevice(deviceId);
|
const res = await getDevice(deviceId);
|
||||||
tableData.value = res.data;
|
tableData.value = res.data;
|
||||||
playUrl.value = `http://localhost:8866/live?url=${tableData.value.url}`;
|
// 使用当前访问的域名和端口,通过Nginx代理访问视频流
|
||||||
|
playUrl.value = `${window.location.origin}/live?url=${tableData.value.url}`;
|
||||||
handlePlay();
|
handlePlay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.ruoyi.web.controller.video;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -33,6 +34,9 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||||||
public class DeviceController extends BaseController {
|
public class DeviceController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDeviceService deviceService;
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
|
@Value("${server.port:8080}")
|
||||||
|
private String serverPort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备列表
|
* 查询设备列表
|
||||||
|
|||||||
Reference in New Issue
Block a user