Enhance: platform order create flow carries back and redirects with back
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
@csrf
|
||||
|
||||
<input type="hidden" name="site_subscription_id" value="{{ old('site_subscription_id', $defaults['site_subscription_id'] ?? '') }}">
|
||||
<input type="hidden" name="back" value="{{ old('back', $defaults['back'] ?? '') }}">
|
||||
|
||||
<label>
|
||||
<span>站点</span>
|
||||
@@ -79,7 +80,17 @@
|
||||
</label>
|
||||
|
||||
<div class="form-actions">
|
||||
<a href="/admin/platform-orders" class="btn-secondary">返回</a>
|
||||
@php
|
||||
$incomingBack = (string) ($defaults['back'] ?? '');
|
||||
$safeBack = str_starts_with($incomingBack, '/') ? $incomingBack : '';
|
||||
@endphp
|
||||
|
||||
@if($safeBack)
|
||||
<a href="{{ $safeBack }}" class="btn-secondary">返回(保留上下文)</a>
|
||||
@else
|
||||
<a href="/admin/platform-orders" class="btn-secondary">返回</a>
|
||||
@endif
|
||||
|
||||
<button type="submit">创建订单</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user