From a13809ac02d36647e5e7a49386651f318f1bee05 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Tue, 10 Mar 2020 13:27:04 +0800 Subject: [PATCH] opt 1.2.3 --- app/Http/Controllers/Admin/ServerController.php | 15 +++++++++++---- app/Http/Requests/Admin/ServerSave.php | 3 ++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Admin/ServerController.php b/app/Http/Controllers/Admin/ServerController.php index dfed0a11..65456fc6 100755 --- a/app/Http/Controllers/Admin/ServerController.php +++ b/app/Http/Controllers/Admin/ServerController.php @@ -40,18 +40,25 @@ class ServerController extends Controller if (isset($params['tags'])) { $params['tags'] = json_encode($params['tags']); } - if (isset($params['rules'])) { - if (!is_object(json_decode($params['rules']))) { + + if (isset($params['ruleSettings'])) { + if (!is_object(json_decode($params['ruleSettings']))) { abort(500, '审计规则配置格式不正确'); } } - if (isset($params['settings'])) { - if (!is_object(json_decode($params['settings']))) { + if (isset($params['networkSettings'])) { + if (!is_object(json_decode($params['networkSettings']))) { abort(500, '传输协议配置格式不正确'); } } + if (isset($params['tlsSettings'])) { + if (!is_object(json_decode($params['tlsSettings']))) { + abort(500, 'TLS配置格式不正确'); + } + } + if ($request->input('id')) { $server = Server::find($request->input('id')); if (!$server) { diff --git a/app/Http/Requests/Admin/ServerSave.php b/app/Http/Requests/Admin/ServerSave.php index 65ecb4b5..ff472c28 100755 --- a/app/Http/Requests/Admin/ServerSave.php +++ b/app/Http/Requests/Admin/ServerSave.php @@ -19,7 +19,8 @@ class ServerSave extends FormRequest 'rate' => 'required|numeric', 'network' => 'required|in:tcp,kcp,ws,http,domainsocket,quic', 'networkSettings' => '', - 'ruleSettings' => '' + 'ruleSettings' => '', + 'tlsSettings' => '' ]; /** * Get the validation rules that apply to the request.