libushang 1 miesiąc temu
rodzic
commit
d8b61d0cdf

+ 2 - 2
common/enc/three_proofing_responsible_person_data.py

@@ -57,8 +57,8 @@ def get_sign_str(row: ThreeProofingResponsiblePerson) -> str:
     position = mpfun.base64_data(row.position) # 职务
     area_code2 = row.area_code2 # 区划编码2
     area_code = str(row.area_code) # 区划编码
-    phone = mpfun.enc_data(row.phone) # 手机号码
-    telephone = mpfun.enc_data(row.telephone) # 办公电话
+    phone = (row.phone) # 手机号码
+    telephone = (row.telephone) # 办公电话
     del_flag = row.del_flag # 是否已删除
 
     # 关键字段合并字符串

+ 10 - 0
routers/api/ThreeProofingResponsible/person.py

@@ -312,6 +312,10 @@ async def get_emergency_contact_list(
         # 执行分页查询
         contact_infos = query.offset((page - 1) * pageSize).limit(pageSize).all()
 
+        for info in contact_infos:
+            if three_proofing_responsible_person_data.sign_valid_row(info) == False:
+                raise HmacException(500, "三防责任人管理人员信息表验证异常,已被非法篡改")
+
         # 将查询结果转换为列表形式的字典
         contact_infos_list = []
         for info in contact_infos:
@@ -355,6 +359,12 @@ async def get_emergency_contact_list(
             "data": contact_infos_list,
             "total": total_items
         }
+    
+    except HmacException as e:
+        return {
+            "code": e.code,
+            "msg": e.msg
+        }
 
     except Exception as e:
         # 处理异常