[skip ci] Update version to v1.4.26

This commit is contained in:
Gitea Actions Bot
2025-10-11 10:13:08 +08:00
parent 80e9bba722
commit 9a2ea3f2a3
2 changed files with 358 additions and 342 deletions

268
config.py
View File

@@ -1,135 +1,135 @@
# -*- coding: utf-8 -*-
"""
项目配置文件
统一管理所有配置参数,避免硬编码
"""
# 用户访问令牌(默认空字符串)
import os # 用于路径与目录操作(写入用户配置目录)
import json # 用于将令牌保存为 JSON 格式
# 后端服务器配置
# BACKEND_HOST = "192.168.5.233"
BACKEND_HOST = "192.168.5.12"
# BACKEND_HOST = "shuidrop.com"
# BACKEND_HOST = "test.shuidrop.com"
BACKEND_PORT = "8000"
# BACKEND_PORT = ""
BACKEND_WS_URL = f"ws://{BACKEND_HOST}:{BACKEND_PORT}"
# BACKEND_WS_URL = f"wss://{BACKEND_HOST}"
# WebSocket配置
WS_CONNECT_TIMEOUT = 16.0
WS_MESSAGE_TIMEOUT = 30.0
WS_PING_INTERVAL = 10 # 10秒ping间隔提高检测频率
WS_PING_TIMEOUT = 5 # 5秒ping超时更快检测断线
WS_ENABLE_PING = True # 是否启用WebSocket原生ping心跳
WS_ENABLE_APP_PING = False # 禁用应用层ping心跳避免重复
# AI处理超时配置
AI_PROCESS_TIMEOUT = 30 # AI处理超时时间
AI_LONG_PROCESS_THRESHOLD = 10 # AI长时间处理阈值
# 内存管理配置
MAX_PENDING_REPLIES = 100
CLEANUP_INTERVAL = 300 # 5分钟
FUTURE_TIMEOUT = 300 # 5分钟
# 终端日志配置(简化)
LOG_LEVEL = "INFO"
VERSION = "1.0"
# GUI配置
WINDOW_TITLE = "AI回复连接入口-V1.0"
# 应用版本号(用于版本检查)
APP_VERSION = "1.4.24"
# 平台特定配置
PLATFORMS = {
"JD": {
"name": "京东",
"ws_url": "wss://dongdong.jd.com/workbench/websocket"
},
"DOUYIN": {
"name": "抖音",
"ws_url": None # 动态获取
},
"QIANNIU": {
"name": "千牛(淘宝)",
"ws_url": "ws://127.0.0.1:3030"
},
"PDD": {
"name": "拼多多",
"ws_url": None # 动态获取
}
}
def get_backend_ws_url(platform: str, store_id: str) -> str:
"""获取旧版后端WebSocket URL按店铺建连接保留兼容"""
return f"{BACKEND_WS_URL}/ws/platform/{platform.lower()}/{store_id}/"
def get_gui_ws_url(exe_token: str) -> str:
"""获取新版单连接GUI专用WebSocket URL按用户token建一条连接"""
return f"{BACKEND_WS_URL}/ws/gui/{exe_token}/"
def get_config():
"""获取所有配置"""
return {
'backend_host': BACKEND_HOST,
'backend_port': BACKEND_PORT,
'backend_ws_url': BACKEND_WS_URL,
'ws_connect_timeout': WS_CONNECT_TIMEOUT,
'ws_message_timeout': WS_MESSAGE_TIMEOUT,
'max_pending_replies': MAX_PENDING_REPLIES,
'cleanup_interval': CLEANUP_INTERVAL,
'platforms': PLATFORMS
}
APP_NAME = "ShuidropGUI" # 应用名称(作为配置目录名)
API_TOKEN = 'sd_acF0TisgfFOtsBm4ytqb17MQbcxuX9Vp' # 默认回退令牌(仅当未找到外部配置时使用)
def _get_config_paths():
"""返回(配置目录, 配置文件路径),位于 %APPDATA%/ShuidropGUI/config.json"""
base_dir = os.getenv('APPDATA') or os.path.expanduser('~') # 优先使用 APPDATA其次使用用户主目录
cfg_dir = os.path.join(base_dir, APP_NAME) # 组合配置目录路径
cfg_file = os.path.join(cfg_dir, 'config.json') # 组合配置文件路径
return cfg_dir, cfg_file
def get_saved_token() -> str:
"""优先从外部 JSON 配置读取令牌,不存在时回退到内置 API_TOKEN"""
try:
cfg_dir, cfg_file = _get_config_paths() # 获取目录与文件路径
if os.path.exists(cfg_file): # 如果配置文件存在
with open(cfg_file, 'r', encoding='utf-8') as f: # 以 UTF-8 读取
data = json.load(f) # 解析 JSON 内容
token = data.get('token', '') # 读取 token 字段
if token: # 如果有效
return token # 返回读取到的令牌
except Exception:
pass # 读取失败时静默回退
return API_TOKEN # 回退为内置的默认值
def set_saved_token(new_token: str) -> bool:
"""将访问令牌写入外部 JSON 配置,并更新内存中的值
- new_token: 新的访问令牌字符串
返回: True 表示写入成功False 表示失败
"""
try:
cfg_dir, cfg_file = _get_config_paths()
os.makedirs(cfg_dir, exist_ok=True)
data = {'token': new_token}
with open(cfg_file, 'w', encoding='utf-8') as f:
json.dump(data, f, ensure_ascii=False, indent=2)
# 同步更新内存变量,保证运行期可立即生效
global API_TOKEN
API_TOKEN = new_token
return True
except Exception as e:
# 发生异常时打印提示并返回失败
print(f"写入令牌失败: {e}")
# -*- coding: utf-8 -*-
"""
项目配置文件
统一管理所有配置参数,避免硬编码
"""
# 用户访问令牌(默认空字符串)
import os # 用于路径与目录操作(写入用户配置目录)
import json # 用于将令牌保存为 JSON 格式
# 后端服务器配置
# BACKEND_HOST = "192.168.5.233"
BACKEND_HOST = "192.168.5.12"
# BACKEND_HOST = "shuidrop.com"
# BACKEND_HOST = "test.shuidrop.com"
BACKEND_PORT = "8000"
# BACKEND_PORT = ""
BACKEND_WS_URL = f"ws://{BACKEND_HOST}:{BACKEND_PORT}"
# BACKEND_WS_URL = f"wss://{BACKEND_HOST}"
# WebSocket配置
WS_CONNECT_TIMEOUT = 16.0
WS_MESSAGE_TIMEOUT = 30.0
WS_PING_INTERVAL = 10 # 10秒ping间隔提高检测频率
WS_PING_TIMEOUT = 5 # 5秒ping超时更快检测断线
WS_ENABLE_PING = True # 是否启用WebSocket原生ping心跳
WS_ENABLE_APP_PING = False # 禁用应用层ping心跳避免重复
# AI处理超时配置
AI_PROCESS_TIMEOUT = 30 # AI处理超时时间
AI_LONG_PROCESS_THRESHOLD = 10 # AI长时间处理阈值
# 内存管理配置
MAX_PENDING_REPLIES = 100
CLEANUP_INTERVAL = 300 # 5分钟
FUTURE_TIMEOUT = 300 # 5分钟
# 终端日志配置(简化)
LOG_LEVEL = "INFO"
VERSION = "1.0"
# GUI配置
WINDOW_TITLE = "AI回复连接入口-V1.0"
# 应用版本号(用于版本检查)
APP_VERSION = "1.4.26"
# 平台特定配置
PLATFORMS = {
"JD": {
"name": "京东",
"ws_url": "wss://dongdong.jd.com/workbench/websocket"
},
"DOUYIN": {
"name": "抖音",
"ws_url": None # 动态获取
},
"QIANNIU": {
"name": "千牛(淘宝)",
"ws_url": "ws://127.0.0.1:3030"
},
"PDD": {
"name": "拼多多",
"ws_url": None # 动态获取
}
}
def get_backend_ws_url(platform: str, store_id: str) -> str:
"""获取旧版后端WebSocket URL按店铺建连接保留兼容"""
return f"{BACKEND_WS_URL}/ws/platform/{platform.lower()}/{store_id}/"
def get_gui_ws_url(exe_token: str) -> str:
"""获取新版单连接GUI专用WebSocket URL按用户token建一条连接"""
return f"{BACKEND_WS_URL}/ws/gui/{exe_token}/"
def get_config():
"""获取所有配置"""
return {
'backend_host': BACKEND_HOST,
'backend_port': BACKEND_PORT,
'backend_ws_url': BACKEND_WS_URL,
'ws_connect_timeout': WS_CONNECT_TIMEOUT,
'ws_message_timeout': WS_MESSAGE_TIMEOUT,
'max_pending_replies': MAX_PENDING_REPLIES,
'cleanup_interval': CLEANUP_INTERVAL,
'platforms': PLATFORMS
}
APP_NAME = "ShuidropGUI" # 应用名称(作为配置目录名)
API_TOKEN = 'sd_acF0TisgfFOtsBm4ytqb17MQbcxuX9Vp' # 默认回退令牌(仅当未找到外部配置时使用)
def _get_config_paths():
"""返回(配置目录, 配置文件路径),位于 %APPDATA%/ShuidropGUI/config.json"""
base_dir = os.getenv('APPDATA') or os.path.expanduser('~') # 优先使用 APPDATA其次使用用户主目录
cfg_dir = os.path.join(base_dir, APP_NAME) # 组合配置目录路径
cfg_file = os.path.join(cfg_dir, 'config.json') # 组合配置文件路径
return cfg_dir, cfg_file
def get_saved_token() -> str:
"""优先从外部 JSON 配置读取令牌,不存在时回退到内置 API_TOKEN"""
try:
cfg_dir, cfg_file = _get_config_paths() # 获取目录与文件路径
if os.path.exists(cfg_file): # 如果配置文件存在
with open(cfg_file, 'r', encoding='utf-8') as f: # 以 UTF-8 读取
data = json.load(f) # 解析 JSON 内容
token = data.get('token', '') # 读取 token 字段
if token: # 如果有效
return token # 返回读取到的令牌
except Exception:
pass # 读取失败时静默回退
return API_TOKEN # 回退为内置的默认值
def set_saved_token(new_token: str) -> bool:
"""将访问令牌写入外部 JSON 配置,并更新内存中的值
- new_token: 新的访问令牌字符串
返回: True 表示写入成功False 表示失败
"""
try:
cfg_dir, cfg_file = _get_config_paths()
os.makedirs(cfg_dir, exist_ok=True)
data = {'token': new_token}
with open(cfg_file, 'w', encoding='utf-8') as f:
json.dump(data, f, ensure_ascii=False, indent=2)
# 同步更新内存变量,保证运行期可立即生效
global API_TOKEN
API_TOKEN = new_token
return True
except Exception as e:
# 发生异常时打印提示并返回失败
print(f"写入令牌失败: {e}")
return False

View File

@@ -1,209 +1,225 @@
[
{
"version": "1.4.24",
"update_type": "patch",
"content": "[patch] 优化打包逻辑 控制变量为日志产出 和 安装包整合路径统一",
"author": "haosicheng",
"commit_hash": "31ca5d0819f8f7da907a78f99a22bcc09fb12296",
"commit_short_hash": "31ca5d08",
"branch": "develop",
"release_time": "2025-10-10 16:17:35",
"download_url": "https://shuidrop.com/download/gui/ShuiDi_AI_Assistant_Setup_v1.4.24.exe",
"stats": {
"files_changed": 2,
"lines_added": 31,
"lines_deleted": 47
}
},
{
"version": "1.4.23",
"update_type": "patch",
"content": "Merge remote-tracking branch 'origin/develop' into develop",
"author": "haosicheng",
"commit_hash": "0d9ab498b1bb8df1372e028978f69ad096f47869",
"commit_short_hash": "0d9ab498",
"branch": "develop",
"release_time": "2025-10-10 15:35:22",
"download_url": "https://shuidrop.com/download/gui/ShuiDi_AI_Assistant_Setup_v1.4.23.exe",
"stats": {
"files_changed": 5,
"lines_added": 200,
"lines_deleted": 11
}
},
{
"version": "1.4.22",
"update_type": "patch",
"content": "强制空提交",
"author": "Gitea Actions",
"commit_hash": "8c150054a05a7b0d4795c43d0f2ff8ffade5ae15",
"commit_short_hash": "8c150054",
"branch": "develop",
"release_time": "2025-10-10 14:42:05",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
},
{
"version": "1.4.21",
"update_type": "patch",
"content": "强制空提交",
"author": "Gitea Actions",
"commit_hash": "95acd6e76a7a8ed96c92ae9f55a5ae43f913ddac",
"commit_short_hash": "95acd6e7",
"branch": "develop",
"release_time": "2025-10-10 14:39:17",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
},
{
"version": "1.4.19",
"update_type": "patch",
"content": "Merge branch 'develop' of http://120.92.90.209:3000/magua/shuidrop_gui into develop",
"author": "Gitea Actions",
"commit_hash": "00391fba67f142e9b6966141a712c9719887e295",
"commit_short_hash": "00391fba",
"branch": "develop",
"release_time": "2025-10-10 14:32:03",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 1,
"lines_added": 16,
"lines_deleted": 0
}
},
{
"version": "1.4.18",
"update_type": "patch",
"content": "[patch] 增强版本更新日志输出",
"author": "Gitea Actions",
"commit_hash": "e60c99d81ee0dc5f4c8817591a47f5364b8b1e55",
"commit_short_hash": "e60c99d8",
"branch": "develop",
"release_time": "2025-10-10 14:27:27",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 1,
"lines_added": 31,
"lines_deleted": 5
}
},
{
"version": "1.4.17",
"update_type": "patch",
"content": "[skip ci] Update version to v1.4.16",
"author": "jjz",
"commit_hash": "1b196ac4ca8b34ecb823073f8083497921a75800",
"commit_short_hash": "1b196ac4",
"branch": "develop",
"release_time": "2025-10-10 14:20:34",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 1,
"lines_added": 16,
"lines_deleted": 0
}
},
{
"version": "1.4.16",
"update_type": "patch",
"content": "强制空提交",
"author": "Gitea Actions",
"commit_hash": "0bdac1bff827a07d3a7894ada990c652ddc3db11",
"commit_short_hash": "0bdac1bf",
"branch": "develop",
"release_time": "2025-10-10 14:18:26",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
},
{
"version": "1.4.15",
"update_type": "patch",
"content": "强制空提交",
"author": "Gitea Actions",
"commit_hash": "dddf9a7a74b4feef1e6d600e97855d6390e2c1e1",
"commit_short_hash": "dddf9a7a",
"branch": "develop",
"release_time": "2025-10-10 14:07:49",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
},
{
"version": "1.4.14",
"update_type": "patch",
"content": "强制空提交",
"author": "Gitea Actions",
"commit_hash": "8eb17baf35fd83015d184ea1676314076a90234b",
"commit_short_hash": "8eb17baf",
"branch": "develop",
"release_time": "2025-10-10 13:47:31",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
},
{
"version": "1.4.13",
"update_type": "patch",
"content": "Merge remote-tracking branch 'origin/develop' into develop",
"author": "haosicheng",
"commit_hash": "6ad58b81b0143ac77138235f6ecbb93805fd6db7",
"commit_short_hash": "6ad58b81",
"branch": "develop",
"release_time": "2025-10-10 12:05:18",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 1,
"lines_added": 17,
"lines_deleted": 2
}
},
{
"version": "1.4.12",
"update_type": "patch",
"content": "[patch] 优化版本管理显示 与 更新提示(修改表名信息)",
"author": "haosicheng",
"commit_hash": "c819bdaa1c4d48d7dde2d6508679c135ea7de1df",
"commit_short_hash": "c819bdaa",
"branch": "develop",
"release_time": "2025-10-10 11:54:56",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 5,
"lines_added": 289,
"lines_deleted": 27
}
},
{
"version": "1.4.7",
"update_type": "patch",
"content": "当前版本 - 多平台客服智能助手",
"author": "开发团队",
"commit_hash": "",
"commit_short_hash": "",
"branch": "develop",
"release_time": "2025-10-10 00:00:00",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
}
[
{
"version": "1.4.26",
"update_type": "patch",
"content": "[patch] PDD登录状态GUI回调优化",
"author": "haosicheng",
"commit_hash": "80e9bba722b0f4ffcd0b93c8bf301d356b2e6b40",
"commit_short_hash": "80e9bba7",
"branch": "develop",
"release_time": "2025-10-11 10:13:06",
"download_url": "https://shuidrop.com/download/gui/ShuiDi_AI_Assistant_Setup_v1.4.26.exe",
"stats": {
"files_changed": 1,
"lines_added": 11,
"lines_deleted": 2
}
},
{
"version": "1.4.24",
"update_type": "patch",
"content": "[patch] 优化打包逻辑 控制变量为日志产出 和 安装包整合路径统一",
"author": "haosicheng",
"commit_hash": "31ca5d0819f8f7da907a78f99a22bcc09fb12296",
"commit_short_hash": "31ca5d08",
"branch": "develop",
"release_time": "2025-10-10 16:17:35",
"download_url": "https://shuidrop.com/download/gui/ShuiDi_AI_Assistant_Setup_v1.4.24.exe",
"stats": {
"files_changed": 2,
"lines_added": 31,
"lines_deleted": 47
}
},
{
"version": "1.4.23",
"update_type": "patch",
"content": "Merge remote-tracking branch 'origin/develop' into develop",
"author": "haosicheng",
"commit_hash": "0d9ab498b1bb8df1372e028978f69ad096f47869",
"commit_short_hash": "0d9ab498",
"branch": "develop",
"release_time": "2025-10-10 15:35:22",
"download_url": "https://shuidrop.com/download/gui/ShuiDi_AI_Assistant_Setup_v1.4.23.exe",
"stats": {
"files_changed": 5,
"lines_added": 200,
"lines_deleted": 11
}
},
{
"version": "1.4.22",
"update_type": "patch",
"content": "强制空提交",
"author": "Gitea Actions",
"commit_hash": "8c150054a05a7b0d4795c43d0f2ff8ffade5ae15",
"commit_short_hash": "8c150054",
"branch": "develop",
"release_time": "2025-10-10 14:42:05",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
},
{
"version": "1.4.21",
"update_type": "patch",
"content": "强制空提交",
"author": "Gitea Actions",
"commit_hash": "95acd6e76a7a8ed96c92ae9f55a5ae43f913ddac",
"commit_short_hash": "95acd6e7",
"branch": "develop",
"release_time": "2025-10-10 14:39:17",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
},
{
"version": "1.4.19",
"update_type": "patch",
"content": "Merge branch 'develop' of http://120.92.90.209:3000/magua/shuidrop_gui into develop",
"author": "Gitea Actions",
"commit_hash": "00391fba67f142e9b6966141a712c9719887e295",
"commit_short_hash": "00391fba",
"branch": "develop",
"release_time": "2025-10-10 14:32:03",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 1,
"lines_added": 16,
"lines_deleted": 0
}
},
{
"version": "1.4.18",
"update_type": "patch",
"content": "[patch] 增强版本更新日志输出",
"author": "Gitea Actions",
"commit_hash": "e60c99d81ee0dc5f4c8817591a47f5364b8b1e55",
"commit_short_hash": "e60c99d8",
"branch": "develop",
"release_time": "2025-10-10 14:27:27",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 1,
"lines_added": 31,
"lines_deleted": 5
}
},
{
"version": "1.4.17",
"update_type": "patch",
"content": "[skip ci] Update version to v1.4.16",
"author": "jjz",
"commit_hash": "1b196ac4ca8b34ecb823073f8083497921a75800",
"commit_short_hash": "1b196ac4",
"branch": "develop",
"release_time": "2025-10-10 14:20:34",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 1,
"lines_added": 16,
"lines_deleted": 0
}
},
{
"version": "1.4.16",
"update_type": "patch",
"content": "强制空提交",
"author": "Gitea Actions",
"commit_hash": "0bdac1bff827a07d3a7894ada990c652ddc3db11",
"commit_short_hash": "0bdac1bf",
"branch": "develop",
"release_time": "2025-10-10 14:18:26",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
},
{
"version": "1.4.15",
"update_type": "patch",
"content": "强制空提交",
"author": "Gitea Actions",
"commit_hash": "dddf9a7a74b4feef1e6d600e97855d6390e2c1e1",
"commit_short_hash": "dddf9a7a",
"branch": "develop",
"release_time": "2025-10-10 14:07:49",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
},
{
"version": "1.4.14",
"update_type": "patch",
"content": "强制空提交",
"author": "Gitea Actions",
"commit_hash": "8eb17baf35fd83015d184ea1676314076a90234b",
"commit_short_hash": "8eb17baf",
"branch": "develop",
"release_time": "2025-10-10 13:47:31",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
},
{
"version": "1.4.13",
"update_type": "patch",
"content": "Merge remote-tracking branch 'origin/develop' into develop",
"author": "haosicheng",
"commit_hash": "6ad58b81b0143ac77138235f6ecbb93805fd6db7",
"commit_short_hash": "6ad58b81",
"branch": "develop",
"release_time": "2025-10-10 12:05:18",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 1,
"lines_added": 17,
"lines_deleted": 2
}
},
{
"version": "1.4.12",
"update_type": "patch",
"content": "[patch] 优化版本管理显示 与 更新提示(修改表名信息)",
"author": "haosicheng",
"commit_hash": "c819bdaa1c4d48d7dde2d6508679c135ea7de1df",
"commit_short_hash": "c819bdaa",
"branch": "develop",
"release_time": "2025-10-10 11:54:56",
"download_url": "https://www.baidu.com",
"stats": {
"files_changed": 5,
"lines_added": 289,
"lines_deleted": 27
}
},
{
"version": "1.4.7",
"update_type": "patch",
"content": "当前版本 - 多平台客服智能助手",
"author": "开发团队",
"commit_hash": "",
"commit_short_hash": "",
"branch": "develop",
"release_time": "2025-10-10 00:00:00",
"stats": {
"files_changed": 0,
"lines_added": 0,
"lines_deleted": 0
}
}
]