alroyso 4 months ago
parent
commit
f9af9e9b0c
2 changed files with 14 additions and 0 deletions
  1. 10 0
      lib/app/modules/home/controllers/home_controller.dart
  2. 4 0
      lib/app/utils/utils.dart

+ 10 - 0
lib/app/modules/home/controllers/home_controller.dart

@@ -10,6 +10,7 @@ import 'package:naiyouwl/app/controller/controllers.dart';
 import 'package:naiyouwl/app/utils/shell.dart';
 import 'package:naiyouwl/app/utils/utils.dart';
 import 'package:url_launcher/url_launcher.dart';
+import 'package:wl_base_help/wl_base_help.dart';
 import '../../../clash/service/clash_service.dart';
 import '../../../common/LogHelper.dart';
 import '../../../common/SharedPreferencesUtil.dart';
@@ -112,6 +113,15 @@ class HomeController extends GetxController {
     //   return;
     // }
 
+    if(Platform.isWindows){
+      final proxyManager = WlBaseHelp();
+      final bok = await proxyManager.isDialUpEnabled();
+      if(bok){
+        controllers.global.handleApiError("当前为拨号上网,到用户中心查看教程");
+        return;
+      }
+    }
+
     if(controllers.cc_service.serviceStatus == RunningState.starting){
       controllers.global.handleApiError("服务安装中,请等待");
       return;

+ 4 - 0
lib/app/utils/utils.dart

@@ -85,3 +85,7 @@ Future<int> findAvailablePort(int startPort, {int maxAttempts = 100}) async {
   }
   throw Exception('无法找到可用端口');
 }
+
+
+
+