diff --git a/app/Http/Controllers/Admin/ServerController.php b/app/Http/Controllers/Admin/ServerController.php index 9e059dfd..444f1f16 100755 --- a/app/Http/Controllers/Admin/ServerController.php +++ b/app/Http/Controllers/Admin/ServerController.php @@ -42,6 +42,8 @@ class ServerController extends Controller $server->tls = $request->input('tls'); $server->tags = $request->input('tags') ? json_encode($request->input('tags')) : NULL; $server->rate = $request->input('rate'); + $server->network = $request->input('network'); + $server->settings = $request->input('settings'); return response([ 'data' => $server->save() ]); diff --git a/app/Http/Requests/Admin/ServerSave.php b/app/Http/Requests/Admin/ServerSave.php index ff16ce96..ead245b0 100755 --- a/app/Http/Requests/Admin/ServerSave.php +++ b/app/Http/Requests/Admin/ServerSave.php @@ -21,7 +21,9 @@ class ServerSave extends FormRequest 'server_port' => 'required', 'tls' => 'required', 'tags' => 'array', - 'rate' => 'required|numeric' + 'rate' => 'required|numeric', + 'network' => 'required|in:tcp,mkcp,websocket,http2,domainsocket,quic', + 'settings' => 'json' ]; } @@ -37,7 +39,10 @@ class ServerSave extends FormRequest 'tls.required' => 'TLS不能为空', 'tags.array' => '标签格式不正确', 'rate.required' => '倍率不能为空', - 'rate.numeric' => '倍率格式不正确' + 'rate.numeric' => '倍率格式不正确', + 'network.required' => '传输协议不能为空', + 'network.in' => '传输协议格式不正确', + 'settings.json' => '传输协议配置格式不正确' ]; } }