From 7074d254bcee1cea3d884e4423767ff5dc18037e Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 22 Oct 2025 21:08:17 +0800 Subject: [PATCH] fix(Dashboard):Fix the data distortion issue of bigInt type after adding it to the dashboard --- backend/apps/chat/curd/chat.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/apps/chat/curd/chat.py b/backend/apps/chat/curd/chat.py index 2c8a56a6..c013526f 100644 --- a/backend/apps/chat/curd/chat.py +++ b/backend/apps/chat/curd/chat.py @@ -242,6 +242,14 @@ def get_chat_with_records(session: SessionDep, chart_id: int, current_user: Curr result = list(map(format_record, record_list)) + for row in result: + try: + data_value = row.get('data') # 使用 get 方法,如果键不存在返回 None + if data_value is not None: + row['data'] = format_json_data(data_value) + except Exception: + pass + chat_info.records = result return chat_info