root 5 years ago
parent
commit
361506b897
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/Http/Controllers/Server/DeepbworkController.php

+ 6 - 0
app/Http/Controllers/Server/DeepbworkController.php

@@ -95,7 +95,13 @@ class DeepbworkController extends Controller
     public function config (Request $request) {
         $nodeId = $request->input('node_id');
         $localPort = $request->input('local_port');
+        if (empty($nodeId) || empty($localPort)) {
+            abort(1000, '参数错误');
+        }
         $server = Server::find($nodeId);
+        if (!$server) {
+            abort(1001, '节点不存在');
+        }
         $json = json_decode(self::SERVER_CONFIG);
         $json->inboundDetour[0]->port = (int)$localPort;
         $json->inbound->port = (int)$server->server_port;