feat: [用户前端]补全可选订阅类型

This commit is contained in:
xboard
2023-11-19 14:15:52 +08:00
parent 4353fe1bee
commit 6773c87d8e
5 changed files with 603 additions and 601 deletions

View File

@@ -17,6 +17,7 @@ class ClientController extends Controller
// 节点类型筛选
$allowedTypes = ['vmess', 'vless', 'trojan', 'hysteria', 'hysteria2', 'shadowsocks'];
$types = $request->input('types', "vmess|vless|trojan|hysteria|shadowsocks");
if ($types === "all") $types = implode('|', $allowedTypes);
$typesArr = $types ? collect(explode('|', str_replace(['|','',','], "|" , $types)))->reject(function($type) use ($allowedTypes){
return !in_array($type, $allowedTypes);
})->values()->all() : [];