tokumeikoi hace 3 años
padre
commit
e01e951f7f
Se han modificado 2 ficheros con 4 adiciones y 4 borrados
  1. 3 3
      app/Utils/Clash.php
  2. 1 1
      app/Utils/Shadowrocket.php

+ 3 - 3
app/Utils/Clash.php

@@ -32,7 +32,7 @@ class Clash
 
         if ($server['tls']) {
             $array['tls'] = true;
-            if (isset($server['tlsSettings'])) {
+            if ($server['tlsSettings']) {
                 $tlsSettings = json_decode($server['tlsSettings'], true);
                 if (isset($tlsSettings['allowInsecure']) && !empty($tlsSettings['allowInsecure']))
                     $array['skip-cert-verify'] = ($tlsSettings['allowInsecure'] ? true : false);
@@ -42,7 +42,7 @@ class Clash
         }
         if ($server['network'] === 'ws') {
             $array['network'] = 'ws';
-            if (isset($server['networkSettings'])) {
+            if ($server['networkSettings']) {
                 $wsSettings = json_decode($server['networkSettings'], true);
                 if (isset($wsSettings['path']) && !empty($wsSettings['path']))
                     $array['ws-path'] = $wsSettings['path'];
@@ -52,7 +52,7 @@ class Clash
         }
         if ($server['network'] === 'grpc') {
             $array['network'] = 'grpc';
-            if (isset($server['networkSettings'])) {
+            if ($server['networkSettings']) {
                 $grpcObject = json_decode($server['networkSettings'], true);
                 $array['grpc-opts'] = [];
                 $array['grpc-opts']['grpc-service-name'] = $grpcObject['serviceName'];

+ 1 - 1
app/Utils/Shadowrocket.php

@@ -46,7 +46,7 @@ class Shadowrocket
         }
         if ($server['network'] === 'grpc') {
             $config['obfs'] = "grpc";
-            if (isset($server['networkSettings'])) {
+            if ($server['networkSettings']) {
                 $grpcSettings = json_decode($server['networkSettings'], true);
                 if (isset($grpcSettings['serviceName']) && !empty($grpcSettings['serviceName']))
                     $config['path'] = $grpcSettings['serviceName'];