From c795d4b39ce86ad9b502044d96df9392c0c7dca7 Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期一, 25 十一月 2024 17:39:56 +0800
Subject: [PATCH] ragflow和bisheng的会话时间统一
---
app/service/bisheng.py | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/app/service/bisheng.py b/app/service/bisheng.py
index 0b1fa28..ecf2892 100644
--- a/app/service/bisheng.py
+++ b/app/service/bisheng.py
@@ -68,7 +68,8 @@
{
"id": item["chat_id"],
"name": item["latest_message"]["message"],
- "updated_time": int(datetime.strptime(item["update_time"], "%Y-%m-%dT%H:%M:%S").timestamp() * 1000)
+ "updated_time": int(datetime.strptime(item["update_time"], "%Y-%m-%dT%H:%M:%S").timestamp() * 1000),
+ "update_date": item["update_time"]
}
for item in data
if "latest_message" in item and "message" in item["latest_message"] and item["latest_message"]["message"]
@@ -93,6 +94,7 @@
{
"id": item["chat_id"],
"name": process_name(item),
+ "update_date": item["update_time"].replace("T", " "),
"updated_time": int(datetime.strptime(item["update_time"], "%Y-%m-%dT%H:%M:%S").timestamp() * 1000)
}
for item in data
@@ -156,3 +158,17 @@
response = await client.get(url, headers=headers)
data = self._check_response(response)
return data
+
+
+ async def change_password_public(self, token: str, username: str, password: str, new_password:str) -> dict:
+ url = f"{self.base_url}/api/v1/user/change_password_public"
+ headers = {'cookie': f"access_token_cookie={token};"}
+ public_key = await self.get_public_key_api()
+ password = BishengCrypto(public_key, settings.PRIVATE_KEY).encrypt(password)
+ new_password = BishengCrypto(public_key, settings.PRIVATE_KEY).encrypt(new_password)
+ json = {"username": username, "password": password, "new_password": new_password}
+ async with httpx.AsyncClient() as client:
+ response = await client.post(url, headers=headers, json=json)
+ data = self._check_response(response)
+
+ return data
--
Gitblit v1.8.0