From f6f5a8af7e6c5359e13d7c75172adb0bc6cac555 Mon Sep 17 00:00:00 2001
From: hyb <kk_huangyangbo@163.com>
Date: Fri, 23 Jan 2026 01:53:11 +0000
Subject: [PATCH] feat: 添加用户登录功能、添加注册功能、注册审批功能,参考:注册审批功能测试指南.md、驱动代码模块增加插入其他项目代码功能,驱动代码模块增加插入其他项目代码功能,优化测试报告模块前端布局和美化 - 实现超级用户管理系统用户,可进行增删改查,其他用户只可查看本人的数据,不可进行增删改 - 将Django后台管理中的用户配置相关功能迁移到系统中进行适配、可配置禁用、是否管理员、是否超级用户 - 增加用户管理的分组字段、可直接进行分组操作,实现用户管理即可通过分组配置实现各项目的访问权限 - 实现登录页面注册 - 实现管理员首页点击注册用户审批可实现通过不通过 - 实现未审核用户的登录提示与审核未通过的用户登录提示 - 实现一键插入其他本人可访问项目的脚本代码

---
 测试组/Test_platform/Interface_automation/backend/apps/schema/request.py |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git "a/\346\265\213\350\257\225\347\273\204/Test_platform/Interface_automation/backend/apps/schema/request.py" "b/\346\265\213\350\257\225\347\273\204/Test_platform/Interface_automation/backend/apps/schema/request.py"
index 202ed56..110462c 100644
--- "a/\346\265\213\350\257\225\347\273\204/Test_platform/Interface_automation/backend/apps/schema/request.py"
+++ "b/\346\265\213\350\257\225\347\273\204/Test_platform/Interface_automation/backend/apps/schema/request.py"
@@ -16,6 +16,22 @@
 body = TypeVar("body", bytes, str)
 
 
+def convert_cookies_to_dict(cookies):
+    """
+    将 mitmproxy 的 cookies 对象转换为可 JSON 序列化的字典
+
+    :param cookies: mitmproxy cookies 对象
+    :return: 可序列化的字典
+    """
+    result = {}
+    for key, value in cookies.items():
+        if hasattr(value, 'items'):
+            result[key] = dict(value.items())
+        else:
+            result[key] = value
+    return result
+
+
 class RequestInfo(BaseModel):
     url: str
     body: str
@@ -38,8 +54,8 @@
                     response_headers=dict(flow.response.headers),
                     response_content=self.get_response(flow.response),
                     body=self.get_body(flow.request),
-                    cookies=dict(flow.response.cookies),
-                    request_cookies=dict(flow.request.cookies),
+                    cookies=convert_cookies_to_dict(flow.response.cookies),
+                    request_cookies=convert_cookies_to_dict(flow.request.cookies),
                 )
             )
         super().__init__(**kwargs)

--
Gitblit v1.9.1