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
+15 -7
View File
@@ -1475,18 +1475,22 @@ func init() {
torquerecord.DefaultOperator = torquerecordDescOperator.Default.(string)
// torquerecord.OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
torquerecord.OperatorValidator = torquerecordDescOperator.Validators[0].(func(string) error)
// torquerecordDescOperatorId is the schema descriptor for operatorId field.
torquerecordDescOperatorId := torquerecordFields[9].Descriptor()
// torquerecord.DefaultOperatorId holds the default value on creation for the operatorId field.
torquerecord.DefaultOperatorId = torquerecordDescOperatorId.Default.(int)
// torquerecordDescStationNo is the schema descriptor for stationNo field.
torquerecordDescStationNo := torquerecordFields[9].Descriptor()
torquerecordDescStationNo := torquerecordFields[10].Descriptor()
// torquerecord.DefaultStationNo holds the default value on creation for the stationNo field.
torquerecord.DefaultStationNo = torquerecordDescStationNo.Default.(string)
// torquerecord.StationNoValidator is a validator for the "stationNo" field. It is called by the builders before save.
torquerecord.StationNoValidator = torquerecordDescStationNo.Validators[0].(func(string) error)
// torquerecordDescTime is the schema descriptor for time field.
torquerecordDescTime := torquerecordFields[10].Descriptor()
torquerecordDescTime := torquerecordFields[11].Descriptor()
// torquerecord.DefaultTime holds the default value on creation for the time field.
torquerecord.DefaultTime = torquerecordDescTime.Default.(func() time.Time)
// torquerecordDescCreatedAt is the schema descriptor for createdAt field.
torquerecordDescCreatedAt := torquerecordFields[11].Descriptor()
torquerecordDescCreatedAt := torquerecordFields[12].Descriptor()
// torquerecord.DefaultCreatedAt holds the default value on creation for the createdAt field.
torquerecord.DefaultCreatedAt = torquerecordDescCreatedAt.Default.(func() time.Time)
// torquerecordDescID is the schema descriptor for id field.
@@ -1763,24 +1767,28 @@ func init() {
workpieceprocess.DefaultOperator = workpieceprocessDescOperator.Default.(string)
// workpieceprocess.OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
workpieceprocess.OperatorValidator = workpieceprocessDescOperator.Validators[0].(func(string) error)
// workpieceprocessDescOperatorId is the schema descriptor for operatorId field.
workpieceprocessDescOperatorId := workpieceprocessFields[8].Descriptor()
// workpieceprocess.DefaultOperatorId holds the default value on creation for the operatorId field.
workpieceprocess.DefaultOperatorId = workpieceprocessDescOperatorId.Default.(int)
// workpieceprocessDescResult is the schema descriptor for result field.
workpieceprocessDescResult := workpieceprocessFields[8].Descriptor()
workpieceprocessDescResult := workpieceprocessFields[9].Descriptor()
// workpieceprocess.DefaultResult holds the default value on creation for the result field.
workpieceprocess.DefaultResult = workpieceprocessDescResult.Default.(string)
// workpieceprocess.ResultValidator is a validator for the "result" field. It is called by the builders before save.
workpieceprocess.ResultValidator = workpieceprocessDescResult.Validators[0].(func(string) error)
// workpieceprocessDescDurationSec is the schema descriptor for durationSec field.
workpieceprocessDescDurationSec := workpieceprocessFields[11].Descriptor()
workpieceprocessDescDurationSec := workpieceprocessFields[12].Descriptor()
// workpieceprocess.DefaultDurationSec holds the default value on creation for the durationSec field.
workpieceprocess.DefaultDurationSec = workpieceprocessDescDurationSec.Default.(int)
// workpieceprocessDescRemark is the schema descriptor for remark field.
workpieceprocessDescRemark := workpieceprocessFields[12].Descriptor()
workpieceprocessDescRemark := workpieceprocessFields[13].Descriptor()
// workpieceprocess.DefaultRemark holds the default value on creation for the remark field.
workpieceprocess.DefaultRemark = workpieceprocessDescRemark.Default.(string)
// workpieceprocess.RemarkValidator is a validator for the "remark" field. It is called by the builders before save.
workpieceprocess.RemarkValidator = workpieceprocessDescRemark.Validators[0].(func(string) error)
// workpieceprocessDescCreatedAt is the schema descriptor for createdAt field.
workpieceprocessDescCreatedAt := workpieceprocessFields[13].Descriptor()
workpieceprocessDescCreatedAt := workpieceprocessFields[14].Descriptor()
// workpieceprocess.DefaultCreatedAt holds the default value on creation for the createdAt field.
workpieceprocess.DefaultCreatedAt = workpieceprocessDescCreatedAt.Default.(func() time.Time)
// workpieceprocessDescID is the schema descriptor for id field.