From a7a2282ba7558d7cd1a502d10e308d5a1f4fc09f Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 14 Jan 2026 01:53:11 -0800 Subject: [PATCH] fix(mining-admin-web): update account type categorization to match backend Update categorizeAccounts to use correct account types returned by backend: - Core accounts: HEADQUARTERS, OPERATION, FEE - Region accounts: PROVINCE, CITY Co-Authored-By: Claude Opus 4.5 --- .../system-accounts/api/system-accounts.api.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/mining-admin-web/src/features/system-accounts/api/system-accounts.api.ts b/frontend/mining-admin-web/src/features/system-accounts/api/system-accounts.api.ts index 3d76fe24..78fbe03f 100644 --- a/frontend/mining-admin-web/src/features/system-accounts/api/system-accounts.api.ts +++ b/frontend/mining-admin-web/src/features/system-accounts/api/system-accounts.api.ts @@ -25,19 +25,19 @@ export const systemAccountsApi = { // Helper to categorize accounts for display export function categorizeAccounts(accounts: SystemAccount[]) { - const mainPools = ['DISTRIBUTION_POOL', 'BLACK_HOLE', 'CIRCULATION_POOL']; - const systemAccounts = ['SYSTEM_OPERATION', 'SYSTEM_PROVINCE', 'SYSTEM_CITY']; - const fixedAccounts = ['COST_ACCOUNT', 'OPERATION_ACCOUNT', 'HQ_COMMUNITY', 'RWAD_POOL_PENDING']; + // 核心系统账户类型(HQ、运营、手续费) + const coreAccounts = ['HEADQUARTERS', 'OPERATION', 'FEE']; + // 区域账户类型(省、市) + const regionAccounts = ['PROVINCE', 'CITY']; return { - mainPools: accounts.filter((a) => mainPools.includes(a.accountType)), - systemAccounts: accounts.filter((a) => systemAccounts.includes(a.accountType)), - fixedAccounts: accounts.filter((a) => fixedAccounts.includes(a.accountType)), + mainPools: [], // 池账户现在从 poolAccounts API 获取 + systemAccounts: accounts.filter((a) => coreAccounts.includes(a.accountType)), + fixedAccounts: accounts.filter((a) => regionAccounts.includes(a.accountType)), otherAccounts: accounts.filter( (a) => - !mainPools.includes(a.accountType) && - !systemAccounts.includes(a.accountType) && - !fixedAccounts.includes(a.accountType) + !coreAccounts.includes(a.accountType) && + !regionAccounts.includes(a.accountType) ), }; }