feat embed wallets and add withdrawal records

This commit is contained in:
david
2026-07-29 15:29:49 +08:00
parent 0c94c8033a
commit a7d318a013
7 changed files with 102 additions and 32 deletions

View File

@@ -13,6 +13,10 @@ const frontendDefinitions = [
...source.matchAll(/define\('([^']+)',\s*'[^']+',\s*'([^']+)'/g),
].map((match) => ({ name: match[1], mode: match[2] }));
const frontendNames = frontendDefinitions.map((item) => item.name);
const embeddedResources = new Set([
'wallet_basic', 'wallet_bank', 'wallet_payment', 'wallet_record',
'wallet_refund', 'wallet_apply_cash',
]);
for (const name of frontendNames) {
const item = backend.get(name);
@@ -29,7 +33,7 @@ for (const item of contract.resources) {
throw new Error(
`资源模式不一致:${item.name},后端=${item.mode},前端=${frontend?.mode}`,
);
if (!routes.includes(`'/${item.name}'`))
if (!embeddedResources.has(item.name) && !routes.includes(`'/${item.name}'`))
throw new Error(`缺少后端资源路由:${item.name}`);
}