alroyso 1 month ago
parent
commit
a4df9d2b39
1 changed files with 7 additions and 6 deletions
  1. 7 6
      lib/app/controller/GlobalController.dart

+ 7 - 6
lib/app/controller/GlobalController.dart

@@ -230,13 +230,10 @@ class GlobalController extends GetxController {
       if (!controllers.config.isInitialized.value) {
         await controllers.config.initConfig();
       }
-      
+      nodeModes.value = await ApiService().getNode("/api/client/v4/nodes?vless=1");
       if (!await checkAllCoresStopped()) {
         throw Exception("内核未启动");
       }
-      
-      nodeModes.value = await ApiService().getNode("/api/client/v4/nodes?vless=1");
-
       await makeProxy();
       await controllers.cc_service.reloadClashCore();
     } catch (e) {
@@ -281,12 +278,16 @@ class GlobalController extends GetxController {
 
       await controllers.core.fetchSetProxieGroup(g, name);
       final conn = await controllers.core.fetchConnection();
-      if(conn == null) return;
+      if(conn == null) {
+        LogHelper().d("没有连接数据");
+        return;
+      }
+
       for (final it in conn.connections) {
         if (it.chains.contains(name)) controllers.core.fetchCloseConnections(it.id);
       }
     } catch (e) {
-      handleApiError(e);
+      LogHelper().d("fetchConnection ---- >$e");
     }
   }
   // 创建代理配置文件