449c6d4875
## H5 员工端 v4 (2026-07-13 00:48 已部署)
- 人工按钮三态文案统一为"人工坐席"
- 按钮位置移至发送键和语音按钮上方(垂直堆叠)
- 点按钮直接调 store.shakeAgent(),删除 CallAgentModal 弹窗动画
- 截图快捷键提示改为"截图->粘贴:Alt+Shift+A-Ctrl+V ---> Ctrl+V"
- 移动端隐藏截图提示(CSS 媒体查询)
- AI转人工提示改为"已为您呼叫人工坐席,请稍等!"
- 坐席接入提示改为"坐席正在查看您的信息,请等待处理回复!"
- 删除"摇铃呼叫坐席"入口和文案
- 删除孤儿组件 MessageList.vue + shake 动画 CSS
## H5 员工端 v5 (2026-07-13 02:08 已部署)
- RightPanel v2.1:删除"软件安装"和"资源权限"标签页
- 移除标签栏,智能推荐(DynamicRecommend)直接展示
- 删除 SoftwareDownloads/ApprovalLinks 引用和相关 CSS
## AI 对话链路全栈改造 Phase 1-6 (已部署)
- Phase 1: Dify JSON输出 + 后端blocking解析 + 双WS推送 + 错误降级
- Phase 2: 关键词收窄(~25强意图词) + 两级分类Prompt + 删除前端checkApprovalIntent
- Phase 3: WS扩展(ai_thinking+dynamic_recommend) + ai_structured气泡 + RightPanel v2 + 选项回传
- Phase 4: VisionService接入 + 图片消息融合(5秒窗口) + 降级策略
- Phase 5: 坐席端ai_thinking指示器 + ai_structured/byod_card渲染 + handleNewMessage修复
- Phase 6: diagnosis_stage(6值) + response_time_ms计时 + 慢响应告警(>10s)
## 坐席端 v5 (2026-07-13 01:38 已部署)
- ai_structured/byod_card 只读渲染
- AI思考指示器 UI
- handleNewMessage 透传 msg_type/extra_data 修复
- 布局优化v2.0: QuickReplyBar L1+L2悬浮 + ReplyBox左右分区 + 右栏260/560px切换
- 键盘快捷键v2.3: 纯数字路由 + ESC分层撤销 + Shift+Space用event.code
## 上下文感知智能诊断闭环 (2026-07-12 已部署)
- 三层诊断(API→Script→AI) + 三段排队(VIP→info_locked→not locked)
- 答题插队 + 五场景关闭
- 迁移052(6表+6列) + queue_service + quiz_service + closing_service
- H5前端: QueueWaiting + RightPanel双Tab + InputBar三态 + ResolveConfirmCard
- 坐席前端: pending_close结单流程 + 信息锁定(Dify步骤完成+有效回答率≥70%)
## 知识库迭代3 (2026-07-12 已部署)
- 分诊交互(H5+坐席+Dify独立应用)
- 拓扑预览(ECharts只读)
- 代答排除(4种匹配器: keyword/regex/intent/category)
- 迁移051 + 44文件43测试通过
## 后端变更
- 6个Python文件改造(h5_ai_task.py/h5.py/ai_service.py/closing_service.py等)
- funny_phrase_service.py: shake/connected/keyword 默认文案更新
- session_service.py: 企微消息文案同步
- 新增: queue.py/quiz.py/triage.py/exclusion_rules.py 等API端点
- 新增: diagnostic.py/quiz.py/triage_session.py 等模型
- 新增: closing_service/queue_service/quiz_service/triage_service 等服务
## 文档更新
- CHANGELOG.md: 新增 [未发布] 区全部变更记录
- 项目管理主文档 v2.5: 新增v0.7.3版本 + 已完成看板 + 最近搞定
- 版本记录: 新增v0.7.3条目
- AI对话链路实施计划: Phase 1-6 全部标记✅已实施
- 新增架构图/时序图/类图(mermaid)
## 部署路径修正
- 服务器项目根路径: /opt/wecom-it-desk/
- 所有前端dist均为ro bind mount,只能在宿主机源路径操作
- 服务器nginx /h5/ 是静态文件服务(非proxy_pass)
- elFinder上传二进制不可靠(MD5不匹配),改用base64分块上传
219 lines
9.7 KiB
Nginx Configuration File
219 lines
9.7 KiB
Nginx Configuration File
# =============================================================================
|
|
# 企微智能IT支持服务台 — Nginx 配置(公司内网服务器版)
|
|
# =============================================================================
|
|
# 适用场景:独立域名 itsupport.servyou.com.cn,公司内网 DNS 解析
|
|
# 与 NAS 版的区别:
|
|
# 1. 移除 Cloudflare 相关头(X-Forwarded-Proto https 等)
|
|
# 2. server_name 改为正式域名
|
|
# 3. 真实 IP 直接从 $remote_addr 获取(无 CF 代理层)
|
|
# 4. 预留 HTTPS 配置注释(如公司有统一 SSL 终端)
|
|
# =============================================================================
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
# ------------------------------------------------------------------
|
|
# 日志格式
|
|
# ------------------------------------------------------------------
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
'"$http_user_agent"';
|
|
access_log /var/log/nginx/access.log main;
|
|
error_log /var/log/nginx/error.log warn;
|
|
# ------------------------------------------------------------------
|
|
# 真实 IP 还原(2026-06-15 v0.5.1 修复)
|
|
# ------------------------------------------------------------------
|
|
set_real_ip_from 10.0.0.0/8; # 内网 A 类(代理/WAF 出口)
|
|
set_real_ip_from 172.16.0.0/12; # 内网 B 类
|
|
set_real_ip_from 192.168.0.0/16; # 内网 C 类
|
|
set_real_ip_from 10.212.0.0/16; # VPN 网段
|
|
real_ip_header X-Forwarded-For; # 从 X-Forwarded-For 取最后一个非信任 IP
|
|
real_ip_recursive on; # 递归剥离已信任代理 IP
|
|
# ------------------------------------------------------------------
|
|
# 基础配置
|
|
# ------------------------------------------------------------------
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
tcp_nodelay on;
|
|
keepalive_timeout 65;
|
|
types_hash_max_size 2048;
|
|
client_max_body_size 50m;
|
|
# ------------------------------------------------------------------
|
|
# Gzip 压缩(前端静态资源)
|
|
# ------------------------------------------------------------------
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 1024;
|
|
gzip_types text/plain text/css text/xml text/javascript
|
|
application/javascript application/xml+rss
|
|
application/json application/ld+json;
|
|
# =================================================================
|
|
# 上游服务定义(Docker 内部网络)
|
|
# =================================================================
|
|
upstream backend_api {
|
|
server backend:8000;
|
|
}
|
|
# =================================================================
|
|
# HTTP 服务(监听 80 端口)
|
|
# =================================================================
|
|
server {
|
|
listen 80;
|
|
server_name itsupport.servyou.com.cn;
|
|
location /.well-known/acme-challenge/ {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
# H5 静态文件服务
|
|
location /h5/ {
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
try_files $uri /h5/index.html;
|
|
}
|
|
# H5 API 反向代理
|
|
location /h5/api/ {
|
|
proxy_pass http://backend:8000/;
|
|
proxy_http_version 1.1;
|
|
proxy_redirect off;
|
|
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;
|
|
proxy_set_header Connection "";
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 300s;
|
|
proxy_read_timeout 300s;
|
|
}
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
# =================================================================
|
|
# HTTPS — 443 端口(主服务)
|
|
# =================================================================
|
|
server {
|
|
listen 443 ssl;
|
|
http2 on;
|
|
server_name itsupport.servyou.com.cn;
|
|
ssl_certificate /etc/nginx/ssl/itsupport.servyou.com.cn.crt;
|
|
ssl_certificate_key /etc/nginx/ssl/itsupport.servyou.com.cn.key;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
ssl_prefer_server_ciphers on;
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_session_timeout 1d;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-eval' https://res.wx.qq.com; style-src 'self' 'unsafe-inline' https://res.wx.qq.com; connect-src 'self' wss://itsupport.servyou.com.cn https://itsupport.servyou.com.cn https://qyapi.weixin.qq.com; img-src 'self' data: https://res.wx.qq.com; font-src 'self' data:;" always;
|
|
# 修复:microphone=() 完全禁用麦克风,导致坐席端 Web Speech API 无法使用
|
|
# 改为 microphone=(self) 允许同源页面使用麦克风(浏览器仍会弹窗询问用户)
|
|
add_header Permissions-Policy "camera=(), microphone=(self), geolocation=(), payment=()" always;
|
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
|
# 修复:COEP require-corp 阻止加载企微 JS-SDK 跨域脚本(res.wx.qq.com 不发 CORP 头)
|
|
# 本应用不使用 SharedArrayBuffer / cross-origin isolation,移除 COEP 不影响功能
|
|
# add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
|
server_tokens off;
|
|
location = /health {
|
|
access_log off;
|
|
return 200 "healthy\n";
|
|
add_header Content-Type text/plain;
|
|
}
|
|
# 员工端:/itdesk/ -> 重定向到 /itagent/(保持前端路由 base 一致)
|
|
location /itdesk/ {
|
|
return 301 /itagent/;
|
|
}
|
|
location /itagent/ {
|
|
alias /usr/share/nginx/html/itagent/;
|
|
index index.html;
|
|
try_files $uri $uri/ /itagent/index.html;
|
|
}
|
|
location /itadmin/ {
|
|
allow 10.0.0.0/8;
|
|
allow 172.16.0.0/12;
|
|
allow 192.168.0.0/16;
|
|
allow 10.212.0.0/16;
|
|
allow 10.240.0.0/16;
|
|
allow 117.147.35.138;
|
|
allow 218.75.34.87;
|
|
allow 43.174.152.34;
|
|
#deny all;
|
|
alias /usr/share/nginx/html/itadmin/;
|
|
index index.html;
|
|
try_files $uri /itadmin/index.html;
|
|
}
|
|
location /itportal/ {
|
|
alias /usr/share/nginx/html/itportal/;
|
|
index index.html;
|
|
try_files $uri /itportal/index.html;
|
|
}
|
|
location /api/ {
|
|
location ~ ^/api/admin/ {
|
|
# 修复:剥离 /api/ 前缀,使后端收到 /admin/... 而非 /api/admin/...
|
|
rewrite ^/api/(.*)$ /$1 break;
|
|
allow 10.0.0.0/8;
|
|
allow 172.16.0.0/12;
|
|
allow 192.168.0.0/16;
|
|
allow 10.212.0.0/16;
|
|
#deny all;
|
|
proxy_pass http://backend_api;
|
|
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;
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 300s;
|
|
proxy_read_timeout 300s;
|
|
}
|
|
proxy_pass http://backend_api/;
|
|
proxy_http_version 1.1;
|
|
proxy_redirect off;
|
|
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;
|
|
proxy_set_header Connection "";
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 300s;
|
|
proxy_read_timeout 300s;
|
|
}
|
|
location /ws/ {
|
|
access_log off;
|
|
proxy_pass http://backend_api;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
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_read_timeout 86400s;
|
|
}
|
|
# H5 静态文件服务
|
|
location /h5/ {
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
try_files $uri /h5/index.html;
|
|
}
|
|
# H5 API 反向代理
|
|
location /h5/api/ {
|
|
proxy_pass http://backend:8000/;
|
|
proxy_http_version 1.1;
|
|
proxy_redirect off;
|
|
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;
|
|
proxy_set_header Connection "";
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 300s;
|
|
proxy_read_timeout 300s;
|
|
}
|
|
location = / {
|
|
return 302 /itagent/;
|
|
}
|
|
}
|
|
}
|