mirror of
https://github.com/v2board/v2board.git
synced 2025-02-11 16:00:27 +08:00
opt 1.2.3
This commit is contained in:
parent
5b317478c6
commit
a13809ac02
@ -40,18 +40,25 @@ class ServerController extends Controller
|
|||||||
if (isset($params['tags'])) {
|
if (isset($params['tags'])) {
|
||||||
$params['tags'] = json_encode($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, '审计规则配置格式不正确');
|
abort(500, '审计规则配置格式不正确');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($params['settings'])) {
|
if (isset($params['networkSettings'])) {
|
||||||
if (!is_object(json_decode($params['settings']))) {
|
if (!is_object(json_decode($params['networkSettings']))) {
|
||||||
abort(500, '传输协议配置格式不正确');
|
abort(500, '传输协议配置格式不正确');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($params['tlsSettings'])) {
|
||||||
|
if (!is_object(json_decode($params['tlsSettings']))) {
|
||||||
|
abort(500, 'TLS配置格式不正确');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($request->input('id')) {
|
if ($request->input('id')) {
|
||||||
$server = Server::find($request->input('id'));
|
$server = Server::find($request->input('id'));
|
||||||
if (!$server) {
|
if (!$server) {
|
||||||
|
@ -19,7 +19,8 @@ class ServerSave extends FormRequest
|
|||||||
'rate' => 'required|numeric',
|
'rate' => 'required|numeric',
|
||||||
'network' => 'required|in:tcp,kcp,ws,http,domainsocket,quic',
|
'network' => 'required|in:tcp,kcp,ws,http,domainsocket,quic',
|
||||||
'networkSettings' => '',
|
'networkSettings' => '',
|
||||||
'ruleSettings' => ''
|
'ruleSettings' => '',
|
||||||
|
'tlsSettings' => ''
|
||||||
];
|
];
|
||||||
/**
|
/**
|
||||||
* Get the validation rules that apply to the request.
|
* Get the validation rules that apply to the request.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user