fix: 修复无法建立网络连接时软件卡死问题

This commit is contained in:
DLmaster361
2025-04-29 09:40:11 +08:00
parent 4079188881
commit b51a57a6ee
3 changed files with 12 additions and 3 deletions

View File

@@ -609,7 +609,7 @@ class MaaUserConfig(QConfig):
class AppConfig(GlobalConfig):
VERSION = "4.3.5.1"
VERSION = "4.3.5.2"
gameid_refreshed = Signal()
PASSWORD_refreshed = Signal()

View File

@@ -78,6 +78,8 @@ class _Network(QThread):
def get_json(self, url: str) -> None:
"""通过get方法获取json数据"""
response = None
for _ in range(self.max_retries):
try:
response = requests.get(url, timeout=self.timeout)
@@ -94,7 +96,9 @@ class _Network(QThread):
self.loop.quit()
def get_file(self, url: str, path: Path) -> None:
"""通过get方法获取json数据"""
"""通过get方法下载文件"""
response = None
try:
response = requests.get(url, timeout=10)