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

This commit is contained in:
xboard committed 2023-11-19 14:15:52 +08:00
1 parent 432940c410
commit 494ea58ad8
5 files changed
+603 -601

No files matched your search

@@ -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() : [];