refactor: BackUrl::selfWithoutBack 统一 selfWithoutBack 构造并修复 currentQuery 依赖

This commit is contained in:
萝卜
2026-03-14 18:52:28 +00:00
parent b759a87a57
commit 956e177544
6 changed files with 24 additions and 26 deletions

View File

@@ -6,12 +6,7 @@
@section('content')
@php
// back 参数用于“返回上一页(保留上下文)”,但 back 本身不应再包含 back避免无限嵌套导致 URL 膨胀)
$currentQuery = request()->query();
unset($currentQuery['back']);
$selfWithoutBack = '/' . ltrim(request()->path(), '/');
if (count($currentQuery) > 0) {
$selfWithoutBack .= '?' . \Illuminate\Support\Arr::query($currentQuery);
}
$selfWithoutBack = \App\Support\BackUrl::selfWithoutBack();
// 用于构建“从套餐页跳转到订阅/订单页后可返回套餐页”的链接
$makeSubscriptionUrl = function (array $query) use ($selfWithoutBack) {