|
|
@@ -12,6 +12,7 @@ use App\Http\Models\Order;
|
|
|
use App\Http\Models\ReferralApply;
|
|
|
use App\Http\Models\ReferralLog;
|
|
|
use App\Http\Models\SsConfig;
|
|
|
+use App\Http\Models\SsGroup;
|
|
|
use App\Http\Models\Ticket;
|
|
|
use App\Http\Models\TicketReply;
|
|
|
use App\Http\Models\User;
|
|
|
@@ -80,8 +81,11 @@ class UserController extends Controller
|
|
|
->get();
|
|
|
|
|
|
foreach ($nodeList as &$node) {
|
|
|
+ // 获取分组名称
|
|
|
+ $group = SsGroup::query()->where('id', $node->group_id)->first();
|
|
|
+
|
|
|
// 生成ssr scheme
|
|
|
- $obfs_param = $node->single ? '' : $user->obfs_param;
|
|
|
+ $obfs_param = $user->obfs_param ? $user->obfs_param : $node->obfs_param;
|
|
|
$protocol_param = $node->single ? $user->port . ':' . $user->passwd : $user->protocol_param;
|
|
|
|
|
|
$ssr_str = '';
|
|
|
@@ -91,7 +95,7 @@ class UserController extends Controller
|
|
|
$ssr_str .= '/?obfsparam=' . ($node->single ? '' : base64url_encode($obfs_param));
|
|
|
$ssr_str .= '&protoparam=' . ($node->single ? base64url_encode($user->port . ':' . $user->passwd) : base64url_encode($protocol_param));
|
|
|
$ssr_str .= '&remarks=' . base64url_encode($node->name);
|
|
|
- $ssr_str .= '&group=' . base64url_encode('VPN');
|
|
|
+ $ssr_str .= '&group=' . base64url_encode(empty($group) ? '' : $group->name);
|
|
|
$ssr_str .= '&udpport=0';
|
|
|
$ssr_str .= '&uot=0';
|
|
|
$ssr_str = base64url_encode($ssr_str);
|
|
|
@@ -112,7 +116,7 @@ class UserController extends Controller
|
|
|
$txt .= "协议:" . ($node->single ? $node->single_protocol : $user->protocol) . "\r\n";
|
|
|
$txt .= "协议参数:" . ($node->single ? $user->port . ':' . $user->passwd : $user->protocol_param) . "\r\n";
|
|
|
$txt .= "混淆方式:" . ($node->single ? $node->single_obfs : $user->obfs) . "\r\n";
|
|
|
- $txt .= "混淆参数:" . ($node->single ? '' : $user->obfs_param) . "\r\n";
|
|
|
+ $txt .= "混淆参数:" . ($user->obfs_param ? $user->obfs_param : $node->obfs_param) . "\r\n";
|
|
|
$txt .= "本地端口:1080\r\n路由:绕过局域网及中国大陆地址";
|
|
|
|
|
|
$node->txt = $txt;
|