mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-29 23:47:27 +08:00
fix(node): resolve port type validation error
This commit is contained in:
@@ -18,8 +18,8 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
|
|||||||
* @property string $name 节点名称
|
* @property string $name 节点名称
|
||||||
* @property string $type 服务类型
|
* @property string $type 服务类型
|
||||||
* @property string $host 主机地址
|
* @property string $host 主机地址
|
||||||
* @property string $port 端口
|
* @property string|int $port 端口
|
||||||
* @property string|null $server_port 服务器端口
|
* @property int|null $server_port 服务器端口
|
||||||
* @property array|null $group_ids 分组IDs
|
* @property array|null $group_ids 分组IDs
|
||||||
* @property array|null $route_ids 路由IDs
|
* @property array|null $route_ids 路由IDs
|
||||||
* @property array|null $tags 标签
|
* @property array|null $tags 标签
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ class ServerService
|
|||||||
if (str_contains($server->port, '-')) {
|
if (str_contains($server->port, '-')) {
|
||||||
$server->port = (string) Helper::randomPort($server->port);
|
$server->port = (string) Helper::randomPort($server->port);
|
||||||
$server->ports = $server->port;
|
$server->ports = $server->port;
|
||||||
|
} else {
|
||||||
|
$server->port = (int) $server->port;
|
||||||
}
|
}
|
||||||
$server->password = $server->generateShadowsocksPassword($user);
|
$server->password = $server->generateShadowsocksPassword($user);
|
||||||
return $server;
|
return $server;
|
||||||
|
|||||||
Reference in New Issue
Block a user