修复:

- 节点未配置(nodes.json 域名为空)时更新检查优雅跳过,不再以 "???" 域名连接隧道刷错误日志
- 节点未配置时禁止开启代理:否则系统代理会指向连不通任何目标的转发器导致断网
- 更新检查早退路径重复发送完成信号(原逻辑遗留),统一由 finally 发送
This commit is contained in:
RoyirinRosmontis
2026-08-23 12:41:36 +08:00
parent 1336b9efb4
commit 365171d6a1
+6 -4
View File
@@ -1407,6 +1407,9 @@ class MainWindow(QWidget):
def _start_proxy(self, use_pac, use_bypass_lan): def _start_proxy(self, use_pac, use_bypass_lan):
"""启动本地转发器并设置系统代理(PAC/固定两种模式),可在后台线程调用。""" """启动本地转发器并设置系统代理(PAC/固定两种模式),可在后台线程调用。"""
if _endpoint_domain() == "???":
# 未配置节点时禁止开启:否则系统代理会指向连不通任何目标的转发器,导致断网
raise RuntimeError("未配置节点:请先通过 nodes_url 在线更新或 nodes_tool 导入节点配置")
_traffic_reset() _traffic_reset()
log("TLS 直连模式") log("TLS 直连模式")
ep = _endpoint_domain() ep = _endpoint_domain()
@@ -1605,13 +1608,12 @@ class MainWindow(QWidget):
try: try:
import json, urllib.request, base64 import json, urllib.request, base64
domain = _endpoint_domain() domain = _endpoint_domain()
if domain == "???":
log("更新检查: 未配置节点(nodes.json 域名为空),跳过")
return
# 更新链接优先取 config.json 的 update_url,缺失时回退到域名拼接 # 更新链接优先取 config.json 的 update_url,缺失时回退到域名拼接
url = _config_val("update_url", "") url = _config_val("update_url", "")
if not url: if not url:
if domain == "???":
log("更新检查: 无法获取服务器域名")
self._update_done.emit()
return
url = f"https://{domain}/latest_version.json" url = f"https://{domain}/latest_version.json"
log("正在检查更新...") log("正在检查更新...")
# 显式走本地转发器隧道,不依赖系统代理状态:默认 opener 读注册表代理设置 # 显式走本地转发器隧道,不依赖系统代理状态:默认 opener 读注册表代理设置