v3.3.9版本更新: 1.优化UI界面和按钮样式 2.改进使用说明文字,增加颜色标注 3.优化加载对话框样式 4.添加请求节流机制,防止重复提交 5.完善错误处理和提示信息 6.优化会员状态检查逻辑 7.改进禁用更新功能的实现
This commit is contained in:
@@ -4,8 +4,15 @@ import logging
|
||||
from pathlib import Path
|
||||
|
||||
class Config:
|
||||
"""配置类"""
|
||||
|
||||
def __init__(self):
|
||||
self.api_base_url = "https://cursorapi.nosqli.com/admin"
|
||||
self.base_url = "https://cursorapi.nosqli.com"
|
||||
self.api_endpoints = {
|
||||
"activate": f"{self.base_url}/admin/api.member/activate",
|
||||
"status": f"{self.base_url}/admin/api.member/status",
|
||||
"get_unused": f"{self.base_url}/admin/api.account/getUnused"
|
||||
}
|
||||
self.config_dir = Path(os.path.expanduser("~")) / ".cursor_switcher"
|
||||
self.config_file = self.config_dir / "config.json"
|
||||
self.member_file = self.config_dir / "member.json"
|
||||
@@ -64,4 +71,15 @@ class Config:
|
||||
}
|
||||
with open(self.config_file, "w", encoding="utf-8") as f:
|
||||
json.dump(config, f, indent=2, ensure_ascii=False)
|
||||
self.api_token = api_token
|
||||
self.api_token = api_token
|
||||
|
||||
def get_api_url(self, endpoint_name: str) -> str:
|
||||
"""获取API端点URL
|
||||
|
||||
Args:
|
||||
endpoint_name: 端点名称
|
||||
|
||||
Returns:
|
||||
str: 完整的API URL
|
||||
"""
|
||||
return self.api_endpoints.get(endpoint_name, "")
|
||||
Reference in New Issue
Block a user