From daa0c19f7bed65429ee969306e134d07958fc5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sun, 15 Mar 2026 19:20:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E4=BB=AA=E8=A1=A8=E7=9B=98?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E8=AE=A2=E5=8D=95=E6=9F=A5=E7=9C=8B=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E9=93=BE=E6=8E=A5=E6=90=BA=E5=B8=A6=20back?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/admin/dashboard.blade.php | 5 ++- ...rmOrdersViewAllLinkShouldCarryBackTest.php | 32 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/AdminDashboardRecentPlatformOrdersViewAllLinkShouldCarryBackTest.php diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 7d64c99..a899b62 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -117,7 +117,10 @@

最近平台订单

- 查看全部 + @php + $platformOrdersIndexUrl = \App\Support\BackUrl::withBack('/admin/platform-orders', $selfWithoutBack); + @endphp + 查看全部
diff --git a/tests/Feature/AdminDashboardRecentPlatformOrdersViewAllLinkShouldCarryBackTest.php b/tests/Feature/AdminDashboardRecentPlatformOrdersViewAllLinkShouldCarryBackTest.php new file mode 100644 index 0000000..bc8e087 --- /dev/null +++ b/tests/Feature/AdminDashboardRecentPlatformOrdersViewAllLinkShouldCarryBackTest.php @@ -0,0 +1,32 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_dashboard_recent_platform_orders_view_all_link_should_carry_back(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin'); + $res->assertOk(); + + $res->assertSee('href="/admin/platform-orders?back=%2Fadmin"', false); + $res->assertDontSee('&back=', false); + } +}