From f13239560d9a6888d3bf95699ed5fc10395b50ff Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期一, 24 二月 2025 18:57:51 +0800
Subject: [PATCH] 历史记录增加

---
 app/service/v2/app_driver/chat_data.py |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/app/service/v2/app_driver/chat_data.py b/app/service/v2/app_driver/chat_data.py
index 52e6883..45919cb 100644
--- a/app/service/v2/app_driver/chat_data.py
+++ b/app/service/v2/app_driver/chat_data.py
@@ -16,15 +16,6 @@
         else:
             return {}
 
-    async def chat_ping(self, url, params, headers):
-        res = await self.http_get(url, params, headers)
-        if res.status_code != 200:
-            return 0
-        if res.json().get("code") == "unauthorized" or res.json().get("code") == 401:
-            return 0
-        return 200
-
-
     async def chat_post(self, url, data, headers):
 
         res = await self.http_post(url, data, headers)
@@ -32,6 +23,14 @@
             return res.json()
         else:
             return {}
+
+    async def chat_ping(self, url, params, headers):
+        res = await self.http_get(url, params, headers)
+        if res.status_code != 200:
+            return 0
+        if res.json().get("code") == "unauthorized" or res.json().get("code") == 401:
+            return 0
+        return 200
 
     async def chat_login(self, url, data, headers):
 
@@ -42,6 +41,14 @@
             if authorization:
                 res_json["data"]["access_token"] = authorization
             return res_json
+        else:
+            return {}
+
+    async def chat_upload(self, url, files, data,  headers):
+
+        res = await self.http_upload_file(url, headers=headers, files=files, data=data)
+        if res.status_code == 200 or res.status_code == 201:
+            return res.json()
         else:
             return {}
 
@@ -84,7 +91,8 @@
 
         ping_url = "http://192.168.20.116:11080/v1/system/version"
         # ping_url = "http://192.168.20.119:13002/console/api/workspaces"
-        user_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNjEzNzdiYzctZTViYy00YjhiLTgxYTYtNWZkOTVhODVlMmE4IiwiZXhwIjoxNzM5MjU3Njk1LCJpc3MiOiJTRUxGX0hPU1RFRCIsInN1YiI6IkNvbnNvbGUgQVBJIFBhc3Nwb3J0In0.w7xQrepd1dYR4iPXcbuthIZjdm45bTJFbolOM_SE9aQ"
+        user_token = "eyJhbG|ciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNjEzNzdiYzctZTViYy00YjhiLTgxYTYtNWZkOTVhODVlMmE4IiwiZXhwIjoxNzM5MjU3Njk1LCJpc3MiOiJTRUxGX0hPU1RFRCIsInN1YiI6IkNvbnNvbGUgQVBJIFBhc3Nwb3J0In0.w7xQrepd1dYR4iPXcbuthIZjdm45bTJFbolOM_SE9aQ"
+        user_token = "IjhkYTliMGE4ZWRjMjExZWY5OGI4MDI0MmFjMTIwMDA2Ig.Z7QqNA.8aN6VhyxupQdsb5Vlp7mwqTT4sA"
         # token = "Bearer {}"
         token = "{}"
         res = await chat.chat_ping(ping_url, {}, await chat.get_chat_headers(token.format(user_token)))

--
Gitblit v1.8.0