Avoid nested back param when generating platform order show links
This commit is contained in:
@@ -8,6 +8,14 @@
|
||||
// 失败原因过长时不生成 sync_error_keyword 链接,避免 URL 过长/特殊字符破坏 query
|
||||
$SYNC_ERROR_KEYWORD_LINK_MAX_LEN = (int) config('saasshop.platform_orders.sync_error_keyword_link_max_len', 200);
|
||||
$SYNC_FAILED_REASON_TRUNCATE_LEN = (int) config('saasshop.platform_orders.sync_failed_reason_display_truncate_len', 60);
|
||||
|
||||
// back 参数用于“返回上一页(保留上下文)”,但 back 本身不应再包含 back(避免无限嵌套导致 URL 膨胀)
|
||||
$currentQuery = request()->query();
|
||||
unset($currentQuery['back']);
|
||||
$selfWithoutBack = '/' . ltrim(request()->path(), '/');
|
||||
if (count($currentQuery) > 0) {
|
||||
$selfWithoutBack .= '?' . \Illuminate\Support\Arr::query($currentQuery);
|
||||
}
|
||||
@endphp
|
||||
<div class="card mb-20">
|
||||
<p class="muted muted-tight">这里是总台视角的平台收费主链骨架页,当前阶段先承接套餐订购 / 续费 / 生效跟踪。</p>
|
||||
@@ -748,7 +756,7 @@
|
||||
@forelse($orders as $order)
|
||||
<tr>
|
||||
<td>{{ $order->id }}</td>
|
||||
<td><a href="/admin/platform-orders/{{ $order->id }}?back={{ urlencode(request()->getRequestUri()) }}">{{ $order->order_no }}</a></td>
|
||||
<td><a href="/admin/platform-orders/{{ $order->id }}?back={{ urlencode($selfWithoutBack) }}">{{ $order->order_no }}</a></td>
|
||||
<td>
|
||||
@if($order->merchant)
|
||||
<a href="{!! request()->fullUrlWithQuery(['merchant_id' => $order->merchant->id, 'page' => null]) !!}" class="link">{{ $order->merchant->name }}</a>
|
||||
|
||||
Reference in New Issue
Block a user