mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-02-08 18:08:13 -05:00
fix: 修复节点密钥未校验是否为空的问题
This commit is contained in:
parent
912cb397ea
commit
a7f42a6459
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user