Merge branch 'main' into main

This commit is contained in:
mozhuanzuojing
2026-02-23 17:22:20 +08:00
committed by GitHub
25 changed files with 702 additions and 263 deletions
+13 -1
View File
@@ -8,9 +8,21 @@ CountBot 应用启动脚本
import os
import sys
from pathlib import Path
from backend.utils.network import get_local_ips
# Windows 平台强制 UTF-8 编码,避免 GBK 编码错误
if sys.platform == "win32":
# Python 3.7+ 支持
os.environ["PYTHONIOENCODING"] = "utf-8"
# 设置控制台代码页为 UTF-8
try:
import ctypes
kernel32 = ctypes.windll.kernel32
kernel32.SetConsoleCP(65001)
kernel32.SetConsoleOutputCP(65001)
except Exception:
pass
# 添加项目根目录到 Python 路径
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))