序列化
This commit is contained in:
@@ -188,11 +188,17 @@ def upload_learning_progress_to_cloud(progress: Dict) -> Dict:
|
||||
base_url = config.get("ASE_ENGINE_URL", "")
|
||||
api_url = f"{base_url}/api/sync/upload"
|
||||
|
||||
# 导入JSON序列化工具
|
||||
from ...utils.json_serializer import json_serialize_dict
|
||||
|
||||
# 序列化进度数据,处理datetime等特殊类型
|
||||
serialized_progress = json_serialize_dict(progress)
|
||||
|
||||
# 构建请求参数
|
||||
payload = {
|
||||
"namespace_url": url_token, # 使用配置中的token作为namespace_url
|
||||
"user_id": progress.get("user_id", ""),
|
||||
"data": progress
|
||||
"data": serialized_progress
|
||||
}
|
||||
|
||||
# 发送POST请求
|
||||
|
||||
Reference in New Issue
Block a user