feat: 会话令牌与守卫、看板组件及工位终端功能完善

- 用户表扩展:MES/WMS user 实体新增字段,新增 active_token 迁移 SQL(2026-11-11)
- 会话机制:MES 新增 session_guard,重构 token/auth/jwt/perm 与路由;WMS/工作站同步令牌续签与鉴权
- 看板(board):调整 MES 看板产线/生产/侧栏/仓库组件及样式;WMS 看板展示页同步调整
- 工位终端后端:完善报警流、绑定、PLC 对账、拧紧、proxy、上报、站点告警/操作等 handler,补充 mes client/store
- 工位终端前端:登录/主界面/各操作面板调整,新增滚动分页与多语言 yaml 文案,刷新构建产物
- MES 业务:新增流程链 logic,调整待审核/产能支撑/产品工艺/设置页、PLC 监控与帮助文档,刷新构建产物
- 更新问题记录文档
This commit is contained in:
SunYF
2026-11-11 14:36:16 +08:00
parent 619fc8983d
commit 7b7d27d150
79 changed files with 2056 additions and 471 deletions
+8
View File
@@ -29,6 +29,8 @@ const (
FieldIsActive = "is_active"
// FieldLastLoginAt holds the string denoting the last_login_at field in the database.
FieldLastLoginAt = "last_login_at"
// FieldActiveToken holds the string denoting the active_token field in the database.
FieldActiveToken = "active_token"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
@@ -49,6 +51,7 @@ var Columns = []string{
FieldPhone,
FieldIsActive,
FieldLastLoginAt,
FieldActiveToken,
FieldCreatedAt,
FieldUpdatedAt,
}
@@ -127,6 +130,11 @@ func ByLastLoginAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLastLoginAt, opts...).ToFunc()
}
// ByActiveToken orders the results by the active_token field.
func ByActiveToken(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldActiveToken, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
+80
View File
@@ -98,6 +98,11 @@ func LastLoginAt(v int64) predicate.User {
return predicate.User(sql.FieldEQ(FieldLastLoginAt, v))
}
// ActiveToken applies equality check predicate on the "active_token" field. It's identical to ActiveTokenEQ.
func ActiveToken(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldActiveToken, v))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v int64) predicate.User {
return predicate.User(sql.FieldEQ(FieldCreatedAt, v))
@@ -638,6 +643,81 @@ func LastLoginAtNotNil() predicate.User {
return predicate.User(sql.FieldNotNull(FieldLastLoginAt))
}
// ActiveTokenEQ applies the EQ predicate on the "active_token" field.
func ActiveTokenEQ(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldActiveToken, v))
}
// ActiveTokenNEQ applies the NEQ predicate on the "active_token" field.
func ActiveTokenNEQ(v string) predicate.User {
return predicate.User(sql.FieldNEQ(FieldActiveToken, v))
}
// ActiveTokenIn applies the In predicate on the "active_token" field.
func ActiveTokenIn(vs ...string) predicate.User {
return predicate.User(sql.FieldIn(FieldActiveToken, vs...))
}
// ActiveTokenNotIn applies the NotIn predicate on the "active_token" field.
func ActiveTokenNotIn(vs ...string) predicate.User {
return predicate.User(sql.FieldNotIn(FieldActiveToken, vs...))
}
// ActiveTokenGT applies the GT predicate on the "active_token" field.
func ActiveTokenGT(v string) predicate.User {
return predicate.User(sql.FieldGT(FieldActiveToken, v))
}
// ActiveTokenGTE applies the GTE predicate on the "active_token" field.
func ActiveTokenGTE(v string) predicate.User {
return predicate.User(sql.FieldGTE(FieldActiveToken, v))
}
// ActiveTokenLT applies the LT predicate on the "active_token" field.
func ActiveTokenLT(v string) predicate.User {
return predicate.User(sql.FieldLT(FieldActiveToken, v))
}
// ActiveTokenLTE applies the LTE predicate on the "active_token" field.
func ActiveTokenLTE(v string) predicate.User {
return predicate.User(sql.FieldLTE(FieldActiveToken, v))
}
// ActiveTokenContains applies the Contains predicate on the "active_token" field.
func ActiveTokenContains(v string) predicate.User {
return predicate.User(sql.FieldContains(FieldActiveToken, v))
}
// ActiveTokenHasPrefix applies the HasPrefix predicate on the "active_token" field.
func ActiveTokenHasPrefix(v string) predicate.User {
return predicate.User(sql.FieldHasPrefix(FieldActiveToken, v))
}
// ActiveTokenHasSuffix applies the HasSuffix predicate on the "active_token" field.
func ActiveTokenHasSuffix(v string) predicate.User {
return predicate.User(sql.FieldHasSuffix(FieldActiveToken, v))
}
// ActiveTokenIsNil applies the IsNil predicate on the "active_token" field.
func ActiveTokenIsNil() predicate.User {
return predicate.User(sql.FieldIsNull(FieldActiveToken))
}
// ActiveTokenNotNil applies the NotNil predicate on the "active_token" field.
func ActiveTokenNotNil() predicate.User {
return predicate.User(sql.FieldNotNull(FieldActiveToken))
}
// ActiveTokenEqualFold applies the EqualFold predicate on the "active_token" field.
func ActiveTokenEqualFold(v string) predicate.User {
return predicate.User(sql.FieldEqualFold(FieldActiveToken, v))
}
// ActiveTokenContainsFold applies the ContainsFold predicate on the "active_token" field.
func ActiveTokenContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldActiveToken, v))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v int64) predicate.User {
return predicate.User(sql.FieldEQ(FieldCreatedAt, v))