From 359b4b7391d432695e8ac7c80f9ec70a6fb182ce Mon Sep 17 00:00:00 2001 From: WuYongJie <549727955@qq.com> Date: Thu, 13 Aug 2026 14:18:33 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=9B=A2=E9=98=9F?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=95=B0=E6=8D=AE=E5=BA=93=E5=85=AC=E7=BD=91?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E5=88=B0=208444=20(#44)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Utilities/TeamSystemDatabaseProfile.php | 2 +- tests/Unit/Utilities/TeamSystemDatabaseProfileTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Utilities/TeamSystemDatabaseProfile.php b/app/Utilities/TeamSystemDatabaseProfile.php index 1e134b24..a4616ccd 100644 --- a/app/Utilities/TeamSystemDatabaseProfile.php +++ b/app/Utilities/TeamSystemDatabaseProfile.php @@ -24,7 +24,7 @@ class TeamSystemDatabaseProfile * 登录密码。资料必须保留在代码层,避免旧容器的 Laravel 配置缓存 * 缺少新配置项时把新人挡在连接页面。 */ - private const EMBEDDED_PROFILE = 'eyJ2IjoxLCJzYWx0IjoiNE5IZWlPS2ltVUxySUI1NkVYYmJudz09IiwiaXYiOiJ6K1JZT0UwNEFlajR5V0ROIiwidGFnIjoiTTJ2NHo2XC9nemh2K0owK1k2aEVCR2c9PSIsImRhdGEiOiJpcFB4TlZwZzZJbW9JN2lyUjlFSzMxV0hPOGF0aWZXMDhKdWFWZThxSFNWYlpGMlIrRW9oM1FwQnB6VjlybTBEXC9hV2VPbEtzSTI3ek5ZVHBcL1VKRzFBT21hK1wvM3g1ViswSlBQT01SN1FXbjhrWVplUWF0ZWNxYzhDZlZnb1ZsclJ2K1wvenlCT2ZnPT0ifQ=='; + private const EMBEDDED_PROFILE = 'eyJ2IjoxLCJzYWx0IjoiSkdEMG5LckgxN3ZUcTRTcVY1N1NEdz09IiwiaXYiOiJoUEQyNmhrSUVPRkh6anpxIiwidGFnIjoib0dcLzVBR241a2ZLV1RxUWdLYVlcLzF3PT0iLCJkYXRhIjoiaFBxMjExdEFwMlZkdnRmVWtWU0h4dlZ2XC9RMmdTWU5jRFlxN1BJSFwvQXJHajVYU0ltbnhFKzRiTTdLaWZqYW1hYXlXNUhWVjR5ZkpYalBkbDV3ajRIWFk5cGFUNXdCZTVlR25qaTFVRGV6SmtHVEM5TUlEeTRqWExRWXBRTnRFVFZiMGFvbWJoIn0='; public function __construct(private readonly ?string $encodedProfile = null) { diff --git a/tests/Unit/Utilities/TeamSystemDatabaseProfileTest.php b/tests/Unit/Utilities/TeamSystemDatabaseProfileTest.php index 043946ce..928e12d5 100644 --- a/tests/Unit/Utilities/TeamSystemDatabaseProfileTest.php +++ b/tests/Unit/Utilities/TeamSystemDatabaseProfileTest.php @@ -12,7 +12,7 @@ class TeamSystemDatabaseProfileTest extends TestCase { $encoded = TeamSystemDatabaseProfile::seal([ 'host' => 'shared-db.test', - 'port' => 3306, + 'port' => 8444, 'database' => 'shared_system', 'username' => 'shared_writer', ], 'correct-password'); @@ -20,7 +20,7 @@ class TeamSystemDatabaseProfileTest extends TestCase $settings = (new TeamSystemDatabaseProfile($encoded))->settings('correct-password'); $this->assertSame('shared-db.test', $settings['host']); - $this->assertSame(3306, $settings['port']); + $this->assertSame(8444, $settings['port']); $this->assertSame('shared_system', $settings['database']); $this->assertSame('shared_writer', $settings['username']); $this->assertSame('correct-password', $settings['password']); From ba5df6eaa49c7b307a83d97348e65049524dc2e3 Mon Sep 17 00:00:00 2001 From: WuYongJie <549727955@qq.com> Date: Thu, 13 Aug 2026 14:45:02 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=8F=E6=84=9F?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E8=AE=B0=E5=BD=95=E4=B8=8E=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E8=A7=84=E5=88=99=20(#45)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ AGENTS.md | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ca0106db..64c0872e 100644 --- a/.gitignore +++ b/.gitignore @@ -106,6 +106,8 @@ modules/* *.pem *.tar /artifacts/ +# 本地私有配置、账号密码和敏感信息文档;禁止使用 git add -f 强制提交。 +/runtime/private/敏感信息.md /runtime/ /.caiwu-build/ .workbuddy/ diff --git a/AGENTS.md b/AGENTS.md index dcc6ec76..cc7cd707 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -83,7 +83,8 @@ ## 6. 数据与安全红线 - 不得提交 `.env`、密码、Token、SSH 私钥、数据库连接串、真实财务数据、客户数据或生产日志。 -- 不得把上述内容粘贴到 AI 对话、工单、PR、聊天群或截图中。 +- 项目负责人明确要求时,可以在当前一对一 AI 对话中直接发送其指定的密码或连接信息;只发送完成当前任务所需的范围,不得自动扩散到工单、PR、聊天群、公开摘要或无关日志。 +- 本项目使用本地私有文档 `runtime/private/敏感信息.md` 记录需要长期保留的密码、Token、服务器和数据库连接等敏感信息。整个 `runtime/` 已被 `.gitignore` 排除;写入前和提交前必须用 `git check-ignore runtime/private/敏感信息.md` 以及暂存区检查确认它不会进入 Git,禁止使用 `git add -f` 强制添加。 - 不得在不确认环境和影响范围时执行数据库写入、迁移、删除、导入、部署或服务器命令。 - 任何包含金额、账户、登录凭据、权限或数据库连接的信息都按敏感数据处理。 - 发现误提交、泄露或错误操作,立即告知负责人;不要自行删除记录掩盖问题。 @@ -142,7 +143,7 @@ ### 8.5 发布安全与验收 - SSH 私钥、`runtime/.env`、镜像临时包、数据库密码不得进入 Git 或 Docker 构建上下文。 -- 首次服务器初始化由脚本生成数据库密码和 `APP_KEY`,不在终端、聊天或文档中输出。 +- 首次服务器初始化由脚本生成数据库密码和 `APP_KEY`,默认只写入服务器私有运行配置和本地 `runtime/private/敏感信息.md`。项目负责人明确要求时可以在当前一对一 AI 对话中提供指定值;不得进入 Git、PR、工单、群聊、公开文档或持久化日志。 - 数据库迁移默认关闭;检测到新增迁移时发布必须停止,获得负责人授权后才可显式开启。 - 新镜像必须先通过本机后端健康检查,再通过公网 HTTPS 页面验收;失败时自动恢复上一个镜像,并保留日志用于排查。 - 生产业务文件统一使用项目唯一的私有七牛桶,固定逻辑盘名为 `uploads`;Access Key 和 Secret Key 只允许存在发布机用户环境、被 Git 忽略的 `runtime/qiniu-business-storage.env` 或服务器 `runtime/qiniu-storage.env`。发布脚本负责首次安全写入服务器私有配置,激活脚本负责读写探测和旧本机上传文件的幂等复制,原件保留用于回滚。新人不得配置对象存储。 From a45436784583f473dfebc394e1198cb6c6ff5208 Mon Sep 17 00:00:00 2001 From: WuYongJie <549727955@qq.com> Date: Thu, 13 Aug 2026 15:41:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B1=E4=BA=AB?= =?UTF-8?q?=E5=BF=AB=E7=85=A7=E5=A4=84=E7=90=86=E4=B8=AD=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=20(#46)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Business/Pages.php | 5 +++ .../UpstreamSnapshotPendingException.php | 16 +++++++++ .../Services/UpstreamQueryCache.php | 6 ++-- .../partials/embedded-table.blade.php | 36 +++++++++++++++++++ .../MarketingAccountBillsTabsTest.php | 33 +++++++++++++++++ .../UpstreamQueryCacheTest.php | 4 ++- 6 files changed, 95 insertions(+), 5 deletions(-) create mode 100644 modules/EcommerceFinance/Exceptions/UpstreamSnapshotPendingException.php diff --git a/app/Http/Controllers/Business/Pages.php b/app/Http/Controllers/Business/Pages.php index 9172eda1..769756eb 100644 --- a/app/Http/Controllers/Business/Pages.php +++ b/app/Http/Controllers/Business/Pages.php @@ -13,6 +13,7 @@ use Illuminate\Routing\Controller; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Pagination\Paginator; use Illuminate\Support\Collection; +use Modules\EcommerceFinance\Exceptions\UpstreamSnapshotPendingException; use Modules\EcommerceFinance\Repositories\AlibabaBillRepository; use Modules\EcommerceFinance\Repositories\EdgeBandingRepository; use Modules\EcommerceFinance\Repositories\InventoryRepository; @@ -248,6 +249,7 @@ class Pages extends Controller 'platform' => $tab, 'balances' => collect(), 'error' => null, + 'pending' => false, ]; if (! in_array($tab, ['taobao-alipay', 'pinduoduo'], true)) { @@ -282,6 +284,9 @@ class Pages extends Controller $pageSize, ), ); + } catch (UpstreamSnapshotPendingException $exception) { + $content['pending'] = true; + $result = ['rows' => [], 'total' => 0]; } catch (ServiceUnavailableHttpException $exception) { $content['error'] = $exception->getMessage(); $result = ['rows' => [], 'total' => 0]; diff --git a/modules/EcommerceFinance/Exceptions/UpstreamSnapshotPendingException.php b/modules/EcommerceFinance/Exceptions/UpstreamSnapshotPendingException.php new file mode 100644 index 00000000..cd472f11 --- /dev/null +++ b/modules/EcommerceFinance/Exceptions/UpstreamSnapshotPendingException.php @@ -0,0 +1,16 @@ +register($scope, $parameters, true); if (! (bool) config('upstreams.snapshots.allow_inline_refresh', false)) { - throw new ServiceUnavailableHttpException( - 15, - '数据同步请求已登记,后台正在准备首份共享数据,请稍后刷新。' - ); + throw new UpstreamSnapshotPendingException(); } $resolved = $this->resolve($scope, $parameters, $resolver, false); diff --git a/resources/views/banking/marketing_account_balances/partials/embedded-table.blade.php b/resources/views/banking/marketing_account_balances/partials/embedded-table.blade.php index ad0f28a4..007e67d5 100644 --- a/resources/views/banking/marketing_account_balances/partials/embedded-table.blade.php +++ b/resources/views/banking/marketing_account_balances/partials/embedded-table.blade.php @@ -24,6 +24,8 @@ .marketing-balance-pagination .page-item.disabled .page-link { color: #595959; cursor: not-allowed; } .marketing-balance-pagination div.lg\:flex > div:first-child { display: none !important; } .marketing-balance-pagination div.lg\:flex { justify-content: center; } + .marketing-balance-status { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; border: 1px solid var(--vip-border, #D8D2C7); border-radius: 12px; background: var(--vip-content-accent-soft, #F7F0DE); padding: 12px 14px; color: #513E21; font-size: 0.875rem; line-height: 1.5; } + .marketing-balance-status .material-icons-outlined { flex: 0 0 auto; color: var(--vip-content-accent-dark, #856632); font-size: 14px; }