From 3d1ecb6c5838fd2b29da14cacbc6e0eed0ec1164 Mon Sep 17 00:00:00 2001 From: WuYongJie <549727955@qq.com> Date: Tue, 21 Jul 2026 19:15:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=A1=A5=E9=BD=90?= =?UTF-8?q?=E8=B4=A6=E5=8D=95=E6=9D=83=E9=99=90=E4=B8=8E=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http/Controllers/AccountBills.php | 15 +++++++++++++++ .../Http/Controllers/AlipayBills.php | 15 +++++++++++++++ scripts/deploy-from-workstation.ps1 | 4 +++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/modules/EcommerceFinance/Http/Controllers/AccountBills.php b/modules/EcommerceFinance/Http/Controllers/AccountBills.php index a1bf5fb82..fbf8d0e8c 100644 --- a/modules/EcommerceFinance/Http/Controllers/AccountBills.php +++ b/modules/EcommerceFinance/Http/Controllers/AccountBills.php @@ -3,6 +3,7 @@ namespace Modules\EcommerceFinance\Http\Controllers; use App\Abstracts\Http\Controller; +use App\Utilities\SidebarPermissions; use Illuminate\Http\Request; use Modules\EcommerceFinance\AccountBillColumns; use Modules\EcommerceFinance\Models\AccountBill; @@ -16,6 +17,8 @@ class AccountBills extends Controller */ public function index(Request $request) { + $this->authorizeStoreReceivingBills(); + $billType = (string) $request->get('bill_type', ''); if (! AccountBillColumns::has($billType)) { @@ -86,6 +89,18 @@ class AccountBills extends Controller public function show(AccountBill $bill) { + $this->authorizeStoreReceivingBills(); + return response()->json($bill); } + + protected function authorizeStoreReceivingBills(): void + { + $section = collect(SidebarPermissions::navigationFor(user())) + ->firstWhere('slug', 'billing-transactions'); + $page = collect($section['pages'] ?? []) + ->firstWhere('slug', 'store-receiving-bills'); + + abort_if(empty($page), 403, '当前账号没有店铺收款账户账单权限。'); + } } diff --git a/modules/EcommerceFinance/Http/Controllers/AlipayBills.php b/modules/EcommerceFinance/Http/Controllers/AlipayBills.php index ab7da6b49..9e7a484c4 100644 --- a/modules/EcommerceFinance/Http/Controllers/AlipayBills.php +++ b/modules/EcommerceFinance/Http/Controllers/AlipayBills.php @@ -3,6 +3,7 @@ namespace Modules\EcommerceFinance\Http\Controllers; use App\Abstracts\Http\Controller; +use App\Utilities\SidebarPermissions; use Illuminate\Http\Request; use Modules\EcommerceFinance\Models\AlipayBill; @@ -14,6 +15,8 @@ class AlipayBills extends Controller */ public function index(Request $request) { + $this->authorizeStoreReceivingBills(); + $query = AlipayBill::query()->where('company_id', company_id()); if ($store = $request->get('store_name')) { @@ -86,6 +89,18 @@ class AlipayBills extends Controller public function show(AlipayBill $bill) { + $this->authorizeStoreReceivingBills(); + return response()->json($bill); } + + protected function authorizeStoreReceivingBills(): void + { + $section = collect(SidebarPermissions::navigationFor(user())) + ->firstWhere('slug', 'billing-transactions'); + $page = collect($section['pages'] ?? []) + ->firstWhere('slug', 'store-receiving-bills'); + + abort_if(empty($page), 403, '当前账号没有店铺收款账户账单权限。'); + } } diff --git a/scripts/deploy-from-workstation.ps1 b/scripts/deploy-from-workstation.ps1 index 0aedd74f0..e1a7e273f 100644 --- a/scripts/deploy-from-workstation.ps1 +++ b/scripts/deploy-from-workstation.ps1 @@ -253,7 +253,9 @@ try { } if ($previousSha -and $previousShaExists) { - $migrationChanges = git diff --name-only "$previousSha..$deploySha" -- database/migrations + $migrationChanges = git diff --name-only "$previousSha..$deploySha" -- ` + database/migrations ` + ':(glob)modules/*/Database/Migrations/*.php' if ($migrationChanges -and -not $AllowMigrations) { throw "检测到数据库迁移:$($migrationChanges -join ', ')。需负责人确认后添加 -AllowMigrations。" }