Fixed few subscription bugs

This commit is contained in:
BrettonYe
2023-04-09 22:06:42 +08:00
committed by BrettonYe
parent 548f0b7042
commit bb0379f0f8
3 changed files with 9 additions and 9 deletions

View File

@@ -19,7 +19,7 @@ trait ClientConfig
if (str_contains($target, 'quantumult')) {
return $this->quantumult();
}
if (str_contains($target, 'clash')) {
if (str_contains($target, 'clash') || str_contains($target, 'stash')) {
return $this->clash();
}
if (str_contains($target, 'bob_vpn')) {
@@ -48,7 +48,7 @@ trait ClientConfig
$user = $this->getUser();
$uri = '';
if (sysConfig('is_custom_subscribe')) {
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=$user->expiration_date");
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=".strtotime($user->expired_at));
}
foreach ($this->getServers() as $server) {
if ($server['type'] === 'shadowsocks') {
@@ -72,7 +72,7 @@ trait ClientConfig
{
$user = $this->getUser();
if (sysConfig('is_custom_subscribe')) {
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=$user->expiration_date");
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=".strtotime($user->expired_at));
}
return $this->origin();
@@ -107,7 +107,7 @@ trait ClientConfig
header('profile-update-interval: 24');
header('profile-web-page-url:'.sysConfig('website_url'));
if (sysConfig('is_custom_subscribe')) {
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=$user->expired_at");
header("subscription-userinfo: upload=$user->u; download=$user->d; total=$user->transfer_enable; expire=".strtotime($user->expired_at));
}
$custom_path = '/resources/rules/custom.clash.yaml';
if ($client === 'bob') {
@@ -198,12 +198,12 @@ trait ClientConfig
}
$text .= ', '.trans('model.user.expired_date').": $user->expiration_date";
} else {
$text .= trans('reason.user.account.reason.expired');
$text .= trans('user.account.reason.expired');
}
$uri .= $this->failedProxyReturn($text, 2);
}
return $uri.$this->origin();
return base64_encode($uri.$this->origin(false));
}
private function shaodowsocksSIP008(): string

View File

@@ -49,7 +49,7 @@ class ProxyService extends BaseService
}
$max = (int) sysConfig('subscribe_max');
if ($max) { // 订阅数量限制
if ($max && count($servers) > $max) { // 订阅数量限制
$servers = Arr::random($servers, $max);
}
@@ -110,7 +110,7 @@ class ProxyService extends BaseService
'type' => 'shadowsocks',
'passwd' => $user->passwd,
], $node->profile);
if ($node->port) {
if ($node->port && $node->port !== 0) {
$config['port'] = $node->port;
} else {
$config['port'] = $user->port;

View File

@@ -2,5 +2,5 @@
return [
'name' => 'ProxyPanel',
'number' => '2.7.e',
'number' => '2.7.f',
];