feat: 实现工位终端滑动续签机制,强化安全与身份追溯

- 新增滑动续签功能:人工触屏触发本地心跳 + 30秒节流刷新JWT,避免作业中令牌过期
- 拆分质量检验权限:过程检/完工检使用不同权限码,细化权限粒度
- 新增操作人用户ID字段:报工、拧紧记录落库时携带可信用户ID,解决身份追溯问题
- 移除编译期默认密钥,启动期校验所有必要密钥非空,防止密钥泄露风险
- 修复WMS附件越权遍历问题:使用UUID文件名替代顺序ID访问附件
- 实现登录态过期数据隔离:仅返回当前操作人的待同步数据,避免身份混淆
This commit is contained in:
SunYF
2026-10-06 19:36:22 +08:00
parent f1cf57e9b2
commit 756d978900
71 changed files with 2417 additions and 556 deletions
+5 -5
View File
@@ -5,6 +5,7 @@ import (
"strings"
"bj_power_mes/common/httpx"
"bj_power_mes/internal/handler/production"
"bj_power_mes/internal/logic"
"bj_power_mes/internal/svc"
)
@@ -32,10 +33,8 @@ func OccupyPointHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
httpx.BadRequest(w, "action 仅支持 IN(上料) / OUT(下料)")
return
}
op := req.Operator
if op == "" {
op = operator(r, "")
}
production.LogImpersonation(svcCtx, r, req.Operator, "/api/internal/line/occupy")
op := production.StationOp(r, req.Operator)
if err := logic.New(svcCtx).OccupyPoint(r.Context(), req.PointNo, req.Sn, req.OrderNo, op, action); err != nil {
httpx.Fail(w, 2407, err.Error())
return
@@ -74,7 +73,8 @@ func CallMaterialHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
httpx.BadRequest(w, "请求体解析失败")
return
}
n, err := logic.New(svcCtx).CallMaterial(r.Context(), req.StationNo, req.Dock, req.OrderNo, operator(r, ""), req.Items)
production.LogImpersonation(svcCtx, r, "", "/api/internal/line/call-material")
n, err := logic.New(svcCtx).CallMaterial(r.Context(), req.StationNo, req.Dock, req.OrderNo, production.StationOp(r, ""), req.Items)
if err != nil {
httpx.Fail(w, 2406, err.Error())
return