refactor: 重构代码结构和类型定义,优化类型安全性和代码可维护性
- 添加类型定义文件和类型引用 - 删除废弃的页面模块和导出文件 - 新增聚合管理模块和插件系统 - 修复类型错误和潜在运行时问题 - 更新API基础URL和配置 - 优化组件类型定义和事件处理 - 重构数据源接口和实现 - 完善文档和开发进度记录
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import { defineConfig } from 'umi';
|
||||
|
||||
export default defineConfig({
|
||||
define: {
|
||||
'process.env.REACT_APP_USE_MOCK': process.env.REACT_APP_USE_MOCK || 'true',
|
||||
'process.env.REACT_APP_API_BASE_URL': process.env.REACT_APP_API_BASE_URL || 'http://localhost:3001',
|
||||
'process.env.REACT_APP_REDUX_DEVTOOLS': process.env.REACT_APP_REDUX_DEVTOOLS || 'true',
|
||||
'process.env.REACT_APP_MSW_DEBUG': process.env.REACT_APP_MSW_DEBUG || 'true',
|
||||
},
|
||||
routes: [
|
||||
// 前台路由(无需登录)
|
||||
{
|
||||
path: '/',
|
||||
component: '@/pages/Homepage',
|
||||
@@ -35,24 +40,583 @@ export default defineConfig({
|
||||
path: 'register',
|
||||
component: '@/pages/Auth/RegisterPage',
|
||||
},
|
||||
{
|
||||
path: 'reset-password',
|
||||
component: '@/pages/Auth/ResetPasswordPage',
|
||||
},
|
||||
],
|
||||
},
|
||||
// 后台路由(需要登录)
|
||||
{
|
||||
path: '/dashboard',
|
||||
layout: '@/layouts/index',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/OperationAgent',
|
||||
component: '@/pages/DashboardPage',
|
||||
},
|
||||
{
|
||||
path: 'overview',
|
||||
component: '@/pages/DashboardPage',
|
||||
},
|
||||
{
|
||||
path: 'aggregation',
|
||||
routes: [
|
||||
{
|
||||
path: 'products',
|
||||
component: '@/pages/Aggregation/AggregatedProductList',
|
||||
},
|
||||
{
|
||||
path: 'orders',
|
||||
component: '@/pages/Aggregation/AggregatedProductList',
|
||||
},
|
||||
{
|
||||
path: 'inventory',
|
||||
component: '@/pages/Aggregation/AggregatedProductList',
|
||||
},
|
||||
{
|
||||
path: 'customers',
|
||||
component: '@/pages/Aggregation/AggregatedProductList',
|
||||
},
|
||||
{
|
||||
path: 'authorization',
|
||||
component: '@/pages/Aggregation/AuthorizationManage',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'operation-agent',
|
||||
component: '@/pages/OperationAgent',
|
||||
},
|
||||
// 其他后台页面
|
||||
{
|
||||
path: 'auto-pilot',
|
||||
component: '@/pages/AutoPilot',
|
||||
},
|
||||
{
|
||||
path: 'task-center',
|
||||
component: '@/pages/TaskCenter',
|
||||
},
|
||||
{
|
||||
path: 'ai-decision-log',
|
||||
component: '@/pages/AIDecisionLog',
|
||||
},
|
||||
{
|
||||
path: 'strategy-marketplace',
|
||||
component: '@/pages/StrategyMarketplace',
|
||||
},
|
||||
{
|
||||
path: 'leaderboard',
|
||||
component: '@/pages/Leaderboard',
|
||||
},
|
||||
{
|
||||
path: 'product',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Product/ProductList',
|
||||
},
|
||||
{
|
||||
path: 'list',
|
||||
component: '@/pages/Product/ProductList',
|
||||
},
|
||||
{
|
||||
path: 'detail/:id?',
|
||||
component: '@/pages/Product/ProductDetail',
|
||||
},
|
||||
{
|
||||
path: 'publish',
|
||||
component: '@/pages/Product/ProductPublishForm',
|
||||
},
|
||||
{
|
||||
path: 'cross-platform',
|
||||
component: '@/pages/Product/CrossPlatformManage',
|
||||
},
|
||||
{
|
||||
path: 'material',
|
||||
component: '@/pages/Product/MaterialUpload',
|
||||
},
|
||||
{
|
||||
path: 'ai-pricing',
|
||||
component: '@/pages/Product/AIPricing',
|
||||
},
|
||||
{
|
||||
path: 'profit-monitor',
|
||||
component: '@/pages/Product/ProfitMonitor',
|
||||
},
|
||||
{
|
||||
path: 'roi-analysis',
|
||||
component: '@/pages/Product/ROIAnalysis',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'orders',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Orders/OrderList',
|
||||
},
|
||||
{
|
||||
path: 'list',
|
||||
component: '@/pages/Orders/OrderList',
|
||||
},
|
||||
{
|
||||
path: 'detail/:id',
|
||||
component: '@/pages/Orders/OrderDetail',
|
||||
},
|
||||
{
|
||||
path: 'exception',
|
||||
component: '@/pages/Orders/ExceptionOrder',
|
||||
},
|
||||
{
|
||||
path: 'aggregation',
|
||||
component: '@/pages/Orders/OrderAggregation',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'inventory',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Product/index',
|
||||
},
|
||||
{
|
||||
path: 'forecast',
|
||||
component: '@/pages/Inventory/InventoryForecast',
|
||||
},
|
||||
{
|
||||
path: 'warehouses',
|
||||
component: '@/pages/Inventory/Warehouses',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'logistics',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Logistics/index',
|
||||
},
|
||||
{
|
||||
path: 'track',
|
||||
component: '@/pages/Logistics/LogisticsTrack',
|
||||
},
|
||||
{
|
||||
path: 'select',
|
||||
component: '@/pages/Logistics/LogisticsSelect',
|
||||
},
|
||||
{
|
||||
path: 'freight-calc',
|
||||
component: '@/pages/Logistics/FreightCalc',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'after-sales',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/AfterSales/index',
|
||||
},
|
||||
{
|
||||
path: 'refund',
|
||||
component: '@/pages/AfterSales/RefundProcess',
|
||||
},
|
||||
{
|
||||
path: 'return-apply',
|
||||
component: '@/pages/AfterSales/ReturnApply',
|
||||
},
|
||||
{
|
||||
path: 'customer-service',
|
||||
component: '@/pages/AfterSales/CustomerService',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'finance',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Finance/index',
|
||||
},
|
||||
{
|
||||
path: 'transactions',
|
||||
component: '@/pages/Finance/Transactions',
|
||||
},
|
||||
{
|
||||
path: 'reconciliation',
|
||||
component: '@/pages/Finance/Reconciliation',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'marketing',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Marketing/index',
|
||||
},
|
||||
{
|
||||
path: 'ads',
|
||||
component: '@/pages/Marketing/Ads',
|
||||
},
|
||||
{
|
||||
path: 'competitors',
|
||||
component: '@/pages/Marketing/Competitors',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'ad',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Ad/index',
|
||||
},
|
||||
{
|
||||
path: 'delivery',
|
||||
component: '@/pages/Ad/AdDelivery',
|
||||
},
|
||||
{
|
||||
path: 'plan',
|
||||
component: '@/pages/Ad/AdPlanPage',
|
||||
},
|
||||
{
|
||||
path: 'roi',
|
||||
component: '@/pages/Ad/ROIAnalysis',
|
||||
},
|
||||
{
|
||||
path: 'auto-adjustment',
|
||||
component: '@/pages/Ad/AutoAdjustment',
|
||||
},
|
||||
{
|
||||
path: 'ai-optimization',
|
||||
component: '@/pages/Ad/AIOptimization',
|
||||
},
|
||||
{
|
||||
path: 'performance',
|
||||
component: '@/pages/Ad/Performance',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'analytics',
|
||||
component: '@/pages/Analytics',
|
||||
},
|
||||
{
|
||||
path: 'reports',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Reports/index',
|
||||
},
|
||||
{
|
||||
path: 'performance',
|
||||
component: '@/pages/Reports/PerformanceReport',
|
||||
},
|
||||
{
|
||||
path: 'profit',
|
||||
component: '@/pages/Reports/ProfitReport',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'multi-shop-report',
|
||||
component: '@/pages/MultiShopReport',
|
||||
},
|
||||
{
|
||||
path: 'order-multi-shop',
|
||||
component: '@/pages/OrderMultiShopList',
|
||||
},
|
||||
{
|
||||
path: 'suppliers',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Suppliers/index',
|
||||
},
|
||||
{
|
||||
path: 'detail/:id?',
|
||||
component: '@/pages/Suppliers/SupplierDetail',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'b2b',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/B2B/index',
|
||||
},
|
||||
{
|
||||
path: 'batch-order',
|
||||
component: '@/pages/B2B/BatchOrder',
|
||||
},
|
||||
{
|
||||
path: 'contract',
|
||||
component: '@/pages/B2B/ContractManage',
|
||||
},
|
||||
{
|
||||
path: 'quote',
|
||||
component: '@/pages/B2B/EnterpriseQuote',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'b2b-trade',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/B2BTrade/index',
|
||||
},
|
||||
{
|
||||
path: 'batch-order',
|
||||
component: '@/pages/B2BTrade/BatchOrder',
|
||||
},
|
||||
{
|
||||
path: 'contract',
|
||||
component: '@/pages/B2BTrade/ContractManage',
|
||||
},
|
||||
{
|
||||
path: 'quote',
|
||||
component: '@/pages/B2BTrade/EnterpriseQuote',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'merchant',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Merchant/index',
|
||||
},
|
||||
{
|
||||
path: 'manage',
|
||||
component: '@/pages/Merchant/MerchantManage',
|
||||
},
|
||||
{
|
||||
path: 'orders',
|
||||
component: '@/pages/Merchant/MerchantOrderManage',
|
||||
},
|
||||
{
|
||||
path: 'shops',
|
||||
component: '@/pages/Merchant/MerchantShopManage',
|
||||
},
|
||||
{
|
||||
path: 'settlement',
|
||||
component: '@/pages/Merchant/MerchantSettlementManage',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'independent-site',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/IndependentSite/IndependentSiteList',
|
||||
},
|
||||
{
|
||||
path: 'list',
|
||||
component: '@/pages/IndependentSite/IndependentSiteList',
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
component: '@/pages/IndependentSite/IndependentSiteCreate',
|
||||
},
|
||||
{
|
||||
path: 'builder',
|
||||
component: '@/pages/IndependentSite/SiteBuilder',
|
||||
},
|
||||
{
|
||||
path: 'templates',
|
||||
component: '@/pages/IndependentSite/SiteTemplates',
|
||||
},
|
||||
{
|
||||
path: 'domains',
|
||||
component: '@/pages/IndependentSite/DomainManagement',
|
||||
},
|
||||
{
|
||||
path: 'config/:id?',
|
||||
component: '@/pages/IndependentSite/IndependentSiteConfig',
|
||||
},
|
||||
{
|
||||
path: 'products/:id',
|
||||
component: '@/pages/IndependentSite/IndependentSiteProduct',
|
||||
},
|
||||
{
|
||||
path: 'orders/:id',
|
||||
component: '@/pages/IndependentSite/IndependentSiteOrder',
|
||||
},
|
||||
{
|
||||
path: 'analytics/:id',
|
||||
component: '@/pages/IndependentSite/IndependentSiteAnalytics',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'compliance',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Compliance/index',
|
||||
},
|
||||
{
|
||||
path: 'certificates',
|
||||
component: '@/pages/Compliance/CertificateManage',
|
||||
},
|
||||
{
|
||||
path: 'check',
|
||||
component: '@/pages/Compliance/ComplianceCheck',
|
||||
},
|
||||
{
|
||||
path: 'expiry-reminder',
|
||||
component: '@/pages/Compliance/CertificateExpiryReminder',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'blacklist',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Blacklist/index',
|
||||
},
|
||||
{
|
||||
path: 'manage',
|
||||
component: '@/pages/Blacklist/BlacklistManage',
|
||||
},
|
||||
{
|
||||
path: 'risk-monitor',
|
||||
component: '@/pages/Blacklist/RiskMonitor',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'return',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Return/index',
|
||||
},
|
||||
{
|
||||
path: 'monitor',
|
||||
component: '@/pages/Return/ReturnMonitor',
|
||||
},
|
||||
{
|
||||
path: 'sku',
|
||||
component: '@/pages/Return/SKUManage',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'user-asset',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/UserAsset/UserAssets',
|
||||
},
|
||||
{
|
||||
path: 'member-level',
|
||||
component: '@/pages/UserAsset/MemberLevel',
|
||||
},
|
||||
{
|
||||
path: 'points',
|
||||
component: '@/pages/UserAsset/PointsManage',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'ab-test',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/ABTest/ABTestConfig',
|
||||
},
|
||||
{
|
||||
path: 'config',
|
||||
component: '@/pages/ABTest/ABTestConfig',
|
||||
},
|
||||
{
|
||||
path: 'results',
|
||||
component: '@/pages/ABTest/ABTestResults',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'dynamic-pricing',
|
||||
component: '@/pages/DynamicPricing',
|
||||
},
|
||||
{
|
||||
path: 'arbitrage-monitor',
|
||||
component: '@/pages/ArbitrageMonitor',
|
||||
},
|
||||
{
|
||||
path: 'auto-product-selection',
|
||||
component: '@/pages/AutoProductSelection',
|
||||
},
|
||||
{
|
||||
path: 'auto-execution',
|
||||
component: '@/pages/AutoExecution',
|
||||
},
|
||||
{
|
||||
path: 'settings',
|
||||
routes: [
|
||||
{
|
||||
path: '',
|
||||
component: '@/pages/Settings/index',
|
||||
},
|
||||
{
|
||||
path: 'profile',
|
||||
component: '@/pages/Settings/ProfileSettings',
|
||||
},
|
||||
{
|
||||
path: 'system',
|
||||
component: '@/pages/Settings/SystemSettings',
|
||||
},
|
||||
{
|
||||
path: 'tenant',
|
||||
component: '@/pages/Settings/TenantSettings',
|
||||
},
|
||||
{
|
||||
path: 'users',
|
||||
component: '@/pages/Settings/UserManagement',
|
||||
},
|
||||
{
|
||||
path: 'platform-account',
|
||||
component: '@/pages/Settings/PlatformAccountConfig',
|
||||
},
|
||||
{
|
||||
path: 'exchange-rate',
|
||||
component: '@/pages/Settings/ExchangeRateConfig',
|
||||
},
|
||||
{
|
||||
path: 'cost-template',
|
||||
component: '@/pages/Settings/CostTemplateConfig',
|
||||
},
|
||||
{
|
||||
path: 'win-node',
|
||||
component: '@/pages/Settings/WinNodeConfig',
|
||||
},
|
||||
{
|
||||
path: 'subscription',
|
||||
component: '@/pages/Settings/SubscriptionManage',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'role',
|
||||
component: '@/pages/Role',
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
component: '@/pages/User',
|
||||
},
|
||||
{
|
||||
path: 'system',
|
||||
component: '@/pages/System',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
fastRefresh: true,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user