mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
rm: remove server name check
This commit is contained in:
parent
326fb5d918
commit
4e2e3cd2a0
@ -14,8 +14,6 @@ class ShadowsocksController extends Controller
|
||||
public function save(ServerShadowsocksSave $request)
|
||||
{
|
||||
$params = $request->validated();
|
||||
$serverService = new ServerService();
|
||||
if ($serverService->serverIsExist($params['name'])) abort(500, '节点名称已存在,请更换名称再试');
|
||||
$params['group_id'] = json_encode($params['group_id']);
|
||||
if (isset($params['tags'])) {
|
||||
$params['tags'] = json_encode($params['tags']);
|
||||
|
@ -14,8 +14,6 @@ class TrojanController extends Controller
|
||||
public function save(ServerTrojanSave $request)
|
||||
{
|
||||
$params = $request->validated();
|
||||
$serverService = new ServerService();
|
||||
if ($serverService->serverIsExist($params['name'])) abort(500, '节点名称已存在,请更换名称再试');
|
||||
$params['group_id'] = json_encode($params['group_id']);
|
||||
if (isset($params['tags'])) {
|
||||
$params['tags'] = json_encode($params['tags']);
|
||||
|
@ -14,9 +14,6 @@ class V2rayController extends Controller
|
||||
public function save(ServerV2raySave $request)
|
||||
{
|
||||
$params = $request->validated();
|
||||
$serverService = new ServerService();
|
||||
if ($serverService->serverIsExist($params['name'])) abort(500, '节点名称已存在,请更换名称再试');
|
||||
|
||||
$params['group_id'] = json_encode($params['group_id']);
|
||||
if (isset($params['tags'])) {
|
||||
$params['tags'] = json_encode($params['tags']);
|
||||
|
@ -357,18 +357,4 @@ class ServerService
|
||||
}
|
||||
return $server->toArray();
|
||||
}
|
||||
|
||||
public function serverIsExist($name):bool
|
||||
{
|
||||
if (ServerShadowsocks::where('name', $name)->count() > 0) {
|
||||
return true;
|
||||
}
|
||||
if (ServerTrojan::where('name', $name)->count() > 0) {
|
||||
return true;
|
||||
}
|
||||
if (Server::where('name', $name)->count() > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user