From 8cfa5a45a97be5d3a5420c85a61aed914a121d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 3 Oct 2026 14:58:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=90=8E=E5=8F=B0=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E9=A2=84=E8=A7=88):=20=E8=A1=A5=E4=B8=8A=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E6=A1=A3=E4=BD=8D=20mock=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - scripts/admin-web-fake-api.mjs:新增 /admin/api/profile/membership-plans 的 GET 列表与 POST 回显,避免页面 response.entries 为 undefined Co-authored-by: Junie --- scripts/admin-web-fake-api.mjs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/scripts/admin-web-fake-api.mjs b/scripts/admin-web-fake-api.mjs index 102703ee4..cdd249d6b 100644 --- a/scripts/admin-web-fake-api.mjs +++ b/scripts/admin-web-fake-api.mjs @@ -736,6 +736,38 @@ function route(pathname, method, url) { scannedCount: orders.length, }; } + if (pathname === '/admin/api/profile/membership-plans') { + const plan = ( + planId, + title, + rank, + monthPriceCents, + yearPriceCents, + periodPoints, + modelAccess, + concurrentJobLimit, + enabled, + ) => ({ + plan: planId, + title, + rank, + monthPriceCents, + yearPriceCents, + periodPoints, + modelAccess, + concurrentJobLimit, + enabled, + }); + const plans = [ + plan('normal', '非会员', 0, 0, 0, 0, 'basic', 1, false), + plan('starter', '入门会员', 1, 3_900, 39_000, 400, 'basic', 1, true), + plan('plus', '轻享会员', 2, 9_900, 99_000, 1_150, 'full', 3, true), + plan('pro', '专业会员', 3, 29_900, 299_000, 3_650, 'full', 5, true), + plan('max', '旗舰会员', 4, 69_900, 699_000, 8_650, 'full', 128, true), + ]; + // 本地预览不解析请求体:POST 统一回显 starter,仅用于页面回填。 + return method === 'POST' ? plans[1] : { entries: plans }; + } if (pathname === '/admin/api/profile/recharge-products') { const product = ( productId,