修改登录退出逻辑

This commit is contained in:
dxc
2026-02-04 14:29:59 +08:00
parent 13590b1fac
commit fd5600b65b
12 changed files with 411 additions and 235 deletions

View File

@ -10,7 +10,8 @@ class MaterialBase(db.Model):
# 1. 基础字段
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(255), nullable=False, comment='基础信息名称')
name = db.Column(db.String(255), nullable=False, comment='名称')
common_name = db.Column(db.String(255), comment='俗名') # ✅ 新增字段
category = db.Column(db.String(100), comment='类别')
material_type = db.Column(db.String(100), comment='类型')
spec_model = db.Column(db.String(255), comment='规格型号')
@ -46,6 +47,7 @@ class MaterialBase(db.Model):
return {
'id': self.id,
'name': self.name,
'commonName': self.common_name, # ✅ 序列化新增字段
'category': self.category,
'type': self.material_type, # 前端字段映射
'spec': self.spec_model, # 前端字段映射