From 77ef0df98e7f79a23e83f7b008b80bd0c348f4cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E6=9C=A8?= <594326199@qq.com> Date: Mon, 21 Sep 2026 15:53:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=BA=97=E9=93=BA=E8=BF=9D?= =?UTF-8?q?=E8=A7=84=E9=A2=84=E8=AD=A6=E5=AD=90=E9=A1=B5=E9=9D=A2=E5=B1=82?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/business_navigation.php | 5 +++-- .../store-violation-alert.blade.php | 1 + tests/Feature/Settings/NavigationTest.php | 18 +++++++++++++++--- .../SystemSettings/UserPermissionsTest.php | 7 +++++-- 4 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 resources/views/business/pages/financial-risk-control/store-violation-alert.blade.php diff --git a/config/business_navigation.php b/config/business_navigation.php index bd34ad2a..e436ab95 100644 --- a/config/business_navigation.php +++ b/config/business_navigation.php @@ -630,8 +630,9 @@ $navigation = [ 'slug' => 'financial-risk-control', 'title' => '财务经营风险管控', 'icon' => 'security', - // Platform views are horizontal tabs inside the page, not sidebar entries. - 'pages' => [], + 'pages' => [ + ['slug' => 'store-violation-alert', 'title' => '店铺违规信息预警'], + ], ], [ 'slug' => 'financial-sw', diff --git a/resources/views/business/pages/financial-risk-control/store-violation-alert.blade.php b/resources/views/business/pages/financial-risk-control/store-violation-alert.blade.php new file mode 100644 index 00000000..6cc9596f --- /dev/null +++ b/resources/views/business/pages/financial-risk-control/store-violation-alert.blade.php @@ -0,0 +1 @@ +@include('business.pages.financial-risk-control.index') diff --git a/tests/Feature/Settings/NavigationTest.php b/tests/Feature/Settings/NavigationTest.php index babb5686..7ede3a61 100644 --- a/tests/Feature/Settings/NavigationTest.php +++ b/tests/Feature/Settings/NavigationTest.php @@ -54,12 +54,24 @@ class NavigationTest extends FeatureTestCase $this->assertSame('financial-sw', $slugs[$riskControlIndex + 1]); $this->assertSame('财务经营风险管控', $navigation[$riskControlIndex]['title']); $this->assertSame('security', $navigation[$riskControlIndex]['icon']); - $this->assertSame([], $navigation[$riskControlIndex]['pages']); + $this->assertSame([ + ['slug' => 'store-violation-alert', 'title' => '店铺违规信息预警'], + ], $navigation[$riskControlIndex]['pages']); $this->loginAs() - ->get(route('business.pages.show', ['section' => 'financial-risk-control']) . '?platform=jd') + ->get(route('business.pages.show', ['section' => 'financial-risk-control'])) + ->assertRedirect(route('business.pages.show', [ + 'section' => 'financial-risk-control', + 'page' => 'store-violation-alert', + ])); + + $this->get(route('business.pages.show', [ + 'section' => 'financial-risk-control', + 'page' => 'store-violation-alert', + ]) . '?platform=jd') ->assertOk() ->assertSeeText('财务经营风险管控') + ->assertSeeText('店铺违规信息预警') ->assertSeeText('淘系') ->assertSeeText('阿里巴巴') ->assertSeeText('京东') @@ -69,7 +81,7 @@ class NavigationTest extends FeatureTestCase ->assertSee('data-active-platform="jd"', false) ->assertSee('id="financial-risk-control-panel-jd"', false) ->assertSee('data-platform-tab="jd"', false) - ->assertSee('/workspace/financial-risk-control', false); + ->assertSee('/workspace/financial-risk-control/store-violation-alert', false); } public function testGroupedNavigationKeepsRestrictedPagePermissions(): void diff --git a/tests/Feature/SystemSettings/UserPermissionsTest.php b/tests/Feature/SystemSettings/UserPermissionsTest.php index 1270d766..f25e190a 100644 --- a/tests/Feature/SystemSettings/UserPermissionsTest.php +++ b/tests/Feature/SystemSettings/UserPermissionsTest.php @@ -128,7 +128,7 @@ class UserPermissionsTest extends FeatureTestCase $this->assertSame(['subject-trademark-rules'], $pages->pluck('slug')->all()); } - public function test_financial_risk_control_section_permission_keeps_platforms_inside_page(): void + public function test_financial_risk_control_section_permission_includes_store_violation_alert(): void { $regular = $this->account('user'); $subject = 'user_'.$regular->id; @@ -140,7 +140,10 @@ class UserPermissionsTest extends FeatureTestCase $navigation = SidebarPermissions::navigationFor($regular); $this->assertSame(['financial-risk-control'], array_column($navigation, 'slug')); - $this->assertSame([], $navigation[0]['pages']); + $this->assertSame( + ['store-violation-alert'], + array_column($navigation[0]['pages'], 'slug') + ); } public function test_legacy_small_payment_permission_follows_the_page_to_financial_operations(): void