diff --git a/src/routers/light.py b/src/routers/light.py index f372798..d0ef893 100644 --- a/src/routers/light.py +++ b/src/routers/light.py @@ -88,8 +88,8 @@ async def get_user_scripts_with_answers(user_id: str): # 构建结果数据 result = [] for script in scripts: - # 复制脚本数据 - script_data = script.copy() + # 复制脚本数据,但排除_id字段 + script_data = {key: value for key, value in script.items() if key != "_id"} # 获取该脚本的code code = script_data.get("code")