From 8bf727055b8cf5d48968bdb4f1b5b76507107381 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 26 Oct 2019 18:54:38 +0800 Subject: [PATCH] update --- app/Http/Controllers/Admin/ServerController.php | 2 +- app/Http/Controllers/Server/DeepbworkController.php | 3 ++- app/Http/Requests/Admin/ServerSave.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Admin/ServerController.php b/app/Http/Controllers/Admin/ServerController.php index 1211be96..7c35141a 100755 --- a/app/Http/Controllers/Admin/ServerController.php +++ b/app/Http/Controllers/Admin/ServerController.php @@ -31,7 +31,7 @@ class ServerController extends Controller $server->name = $request->input('name'); $server->host = $request->input('host'); $server->port = $request->input('port'); - $server->local_port = $request->input('local_port'); + $server->server_port = $request->input('server_port'); $server->tls = $request->input('tls'); $server->tags = json_encode($request->input('tags')); $server->rate = $request->input('rate'); diff --git a/app/Http/Controllers/Server/DeepbworkController.php b/app/Http/Controllers/Server/DeepbworkController.php index dc2edd88..772fb3f3 100644 --- a/app/Http/Controllers/Server/DeepbworkController.php +++ b/app/Http/Controllers/Server/DeepbworkController.php @@ -89,9 +89,10 @@ class DeepbworkController extends Controller // 后端获取配置 public function config (Request $request) { $nodeId = $request->input('node_id'); + $localPort = $request->input('local_port'); $server = Server::find($nodeId); $jsonData = json_decode(self::SERVER_CONFIG); - $jsonData->inboundDetour[0]->port = (int)$server->local_port; + $jsonData->inboundDetour[0]->port = (int)$localPort; $jsonData->inbound->port = (int)$server->port; if ((int)$server->tls) { $jsonData->inbound->streamSettings->security = "tls"; diff --git a/app/Http/Requests/Admin/ServerSave.php b/app/Http/Requests/Admin/ServerSave.php index 45bebbfd..ff16ce96 100755 --- a/app/Http/Requests/Admin/ServerSave.php +++ b/app/Http/Requests/Admin/ServerSave.php @@ -18,7 +18,7 @@ class ServerSave extends FormRequest 'group_id' => 'required|array', 'host' => 'required', 'port' => 'required', - 'local_port' => 'required', + 'server_port' => 'required', 'tls' => 'required', 'tags' => 'array', 'rate' => 'required|numeric' @@ -33,7 +33,7 @@ class ServerSave extends FormRequest 'group_id.array' => '权限组格式不正确', 'host.required' => '节点地址不能为空', 'port.required' => '连接端口不能为空', - 'local_port.required' => '后端服务端口不能为空', + 'server_port.required' => '后端服务端口不能为空', 'tls.required' => 'TLS不能为空', 'tags.array' => '标签格式不正确', 'rate.required' => '倍率不能为空',