fix: 修复节点密钥未校验是否为空的问题
This commit is contained in:
@@ -26,6 +26,7 @@ class Server
|
|||||||
$request->validate([
|
$request->validate([
|
||||||
'token' => [
|
'token' => [
|
||||||
"string",
|
"string",
|
||||||
|
"required",
|
||||||
function ($attribute, $value, $fail) {
|
function ($attribute, $value, $fail) {
|
||||||
if ($value !== admin_setting('server_token')) {
|
if ($value !== admin_setting('server_token')) {
|
||||||
$fail('The ' . $attribute . ' is invalid.');
|
$fail('The ' . $attribute . ' is invalid.');
|
||||||
@@ -34,6 +35,7 @@ class Server
|
|||||||
],
|
],
|
||||||
'node_id' => 'required',
|
'node_id' => 'required',
|
||||||
'node_type' => [
|
'node_type' => [
|
||||||
|
'required',
|
||||||
'nullable',
|
'nullable',
|
||||||
'regex:/^(?i)(hysteria|hysteria2|vless|trojan|vmess|v2ray|tuic|shadowsocks|shadowsocks-plugin)$/',
|
'regex:/^(?i)(hysteria|hysteria2|vless|trojan|vmess|v2ray|tuic|shadowsocks|shadowsocks-plugin)$/',
|
||||||
function ($attribute, $value, $fail) use ($aliasTypes, $request) {
|
function ($attribute, $value, $fail) use ($aliasTypes, $request) {
|
||||||
|
|||||||
Reference in New Issue
Block a user