diff --git a/app/Http/Controllers/Business/Pages.php b/app/Http/Controllers/Business/Pages.php index 9483f821..d619d325 100644 --- a/app/Http/Controllers/Business/Pages.php +++ b/app/Http/Controllers/Business/Pages.php @@ -1162,7 +1162,8 @@ class Pages extends Controller } if ($page === null) { - if ($section === 'courier-payables' || in_array($section, self::PAYABLES_FINAL_SECTIONS, true)) { + if (! SidebarPermissions::hasLimitedDingTalkAccess(user()) + && ($section === 'courier-payables' || in_array($section, self::PAYABLES_FINAL_SECTIONS, true))) { return view('business.pages.show', $this->viewData($sectionConfig)); } diff --git a/tests/Feature/Auth/DingTalkLoginTest.php b/tests/Feature/Auth/DingTalkLoginTest.php index e526dc0d..7f7f58e1 100644 --- a/tests/Feature/Auth/DingTalkLoginTest.php +++ b/tests/Feature/Auth/DingTalkLoginTest.php @@ -378,9 +378,11 @@ class DingTalkLoginTest extends FeatureTestCase 'company_id' => $this->company->id, 'section' => 'supplier-payables-final', ])) - ->assertOk() - ->assertSeeText('赔偿明细') - ->assertDontSeeText('当前账号没有该页面权限'); + ->assertRedirect(route('business.pages.show', [ + 'company_id' => $this->company->id, + 'section' => 'supplier-payables-final', + 'page' => 'compensation-details', + ])); $this->loginAs() ->get(route('business.pages.show', [