往appdata灌石,公私钥对现存储于appdata目录下

sender_okToCheck
Timmoc 3 months ago
parent a14aa4bf31
commit 2bbb0962a1

@ -1,7 +1,11 @@
from enum import Enum, auto
from tool.DownloadPathTool import get_config_path
port = 8426
priKeySavePath = "./private.pem"
pubKeySavePath = "./public.pem"
configPath = get_config_path()
priKeySavePath = f"{configPath}/private.pem"
pubKeySavePath = f"{configPath}/public.pem"
class EncryptType(Enum):
AES_ECB = auto()

@ -3,6 +3,18 @@ import sys
import winreg
from pathlib import Path
def get_config_path():
if sys.platform == 'win32':
# 展开环境变量并转换为标准格式
download_dir = Path(os.path.expandvars("%appdata%/fst")).resolve()
else:
# 对于非 Windows 系统,使用 ~\Downloads 作为默认下载目录
home_dir = Path.home()
download_dir = home_dir / 'fst'
dir_path = Path(download_dir)
if not dir_path.exists():
dir_path.mkdir(parents=True, exist_ok=True)
return str(download_dir)
def get_download_directory():
if sys.platform == 'win32':

Loading…
Cancel
Save