feat(admin-frontend): 完成订阅与系统管理真实工作台

补齐订单、优惠券、主题、插件、公告与支付管理页面,
接入对应后台接口、路由入口与工具层类型定义。
同时修复套餐页开关初始化误写问题,避免浏览即触发写操作。

在订阅协议侧为 Stash 导出增加 AnyTLS 版本守卫,
未知版本或低于 3.3.0 时不再导出该协议,并补充回归测试与知识记录。
This commit is contained in:
yinjianm
2026-04-24 16:52:41 +08:00
parent 16203b14f6
commit f7cef30b9c
89 changed files with 11122 additions and 92 deletions
+21
View File
@@ -10,6 +10,8 @@ use App\Models\Server;
class Stash extends AbstractProtocol
{
private const ANYTLS_MIN_VERSION = '3.3.0';
public $flags = ['stash'];
public $allowedProtocols = [
Server::TYPE_SHADOWSOCKS,
@@ -124,6 +126,16 @@ class Stash extends AbstractProtocol
array_push($proxies, $item['name']);
}
if ($item['type'] === Server::TYPE_ANYTLS) {
if (!self::supportsAnyTlsVersion(
clientVersion: $this->clientVersion,
minimumVersion: data_get(
$this->protocolRequirements,
'stash.anytls.base_version',
self::ANYTLS_MIN_VERSION
)
)) {
continue;
}
array_push($proxy, self::buildAnyTLS($item['password'], $item));
array_push($proxies, $item['name']);
}
@@ -178,6 +190,15 @@ class Stash extends AbstractProtocol
->header('content-disposition', 'attachment;filename*=UTF-8\'\'' . rawurlencode($appName));
}
public static function supportsAnyTlsVersion(?string $clientVersion, ?string $minimumVersion = self::ANYTLS_MIN_VERSION): bool
{
if (!$clientVersion || !$minimumVersion) {
return false;
}
return version_compare($clientVersion, $minimumVersion, '>=');
}
public static function buildShadowsocks($uuid, $server)
{
$protocol_settings = $server['protocol_settings'];