修改大屏

This commit is contained in:
2025-11-18 10:34:38 +08:00
parent 07bd3ce5da
commit a23a828ea3
21 changed files with 498 additions and 66 deletions

View File

@@ -48,6 +48,7 @@ app.use('/api/visualization', require('./routes/visualization'));
app.use('/api/system', require('./routes/system'));
app.use('/api/files', require('./routes/files'));
app.use('/api/government', require('./routes/government'));
app.use('/api/dashboard', require('./routes/dashboard'));
app.use('/api/smart-earmark', require('./routes/smartEarmark'));
app.use('/api/smart-host', require('./routes/smartHost'));
app.use('/api/slaughter', require('./routes/slaughter'));

View File

@@ -93,8 +93,8 @@ server {
access_log /var/log/nginx/wapi.ningmuyun.com.access.log;
error_log /var/log/nginx/wapi.ningmuyun.com.error.log;
# 养殖端API反向代理 - 使用更具体的路径匹配
location ^~ /farm-api/ {
# API反向代理
location /api/ {
proxy_pass http://localhost:5350/api/;
limit_except GET POST OPTIONS { # 确保包含 POST
deny all;
@@ -359,10 +359,11 @@ server {
}
}
# ==================== 政府项目API代理 ====================
# 政府端API统一代理 - 参考银行端设计模式
location ^~ /api/ {
proxy_pass http://localhost:5352/api/;
# location ^~ /government/api/ {
# proxy_pass http://localhost:5352/; # 政府后端服务端口
location ^~ /api/government/auth/ {
proxy_pass http://localhost:5352/api/auth/; # 政府后端认证服务端口
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -384,6 +385,29 @@ server {
return 204;
}
}
location ^~ /api/government/ {
proxy_pass http://localhost:5352/api/government/;
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 X-Forwarded-Proto $scheme;
# CORS配置同上
add_header 'Access-Control-Allow-Origin' 'https://ad.ningmuyun.com' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, X-Requested-With' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' 'https://ad.ningmuyun.com';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, X-Requested-With';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Content-Type' 'text/plain; charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
}
# ==================== 养殖项目 (yangzhi) ====================
location ^~ /farm/ {