223 lines
5.2 KiB
TypeScript
223 lines
5.2 KiB
TypeScript
import { defineConfig } from '@umijs/max';
|
||
|
||
const isDev = process.env.NODE_ENV === 'development';
|
||
const UMI_APP_API_URL = isDev
|
||
? 'http://localhost:7001'
|
||
: 'https://api.yoone.ca';
|
||
import { codeInspectorPlugin } from 'code-inspector-plugin';
|
||
|
||
export default defineConfig({
|
||
hash: true,
|
||
antd: {},
|
||
access: {},
|
||
model: {},
|
||
initialState: {},
|
||
request: {},
|
||
layout: {
|
||
title: 'YOONE',
|
||
},
|
||
define: {
|
||
UMI_APP_API_URL,
|
||
},
|
||
chainWebpack(config) {
|
||
config.plugin('code-inspector-plugin').use(
|
||
codeInspectorPlugin({
|
||
bundler: 'webpack',
|
||
})
|
||
);
|
||
},
|
||
routes: [
|
||
{ path: '/', redirect: '/home' },
|
||
{ name: '追踪', path: '/track', component: './Track', layout: false },
|
||
{ name: '登录', path: '/login', component: './Login', layout: false },
|
||
{ name: '首页', path: '/home', component: './Home' },
|
||
{
|
||
name: '组织架构',
|
||
path: '/organiza',
|
||
access: 'canSeeOrganiza',
|
||
routes: [
|
||
{
|
||
name: '用户管理',
|
||
path: '/organiza/user',
|
||
component: './Organiza/User',
|
||
},
|
||
],
|
||
},
|
||
{
|
||
name: '商品管理',
|
||
path: '/product',
|
||
access: 'canSeeProduct',
|
||
routes: [
|
||
{
|
||
name: '商品分类',
|
||
path: '/product/category',
|
||
component: './Product/Category',
|
||
},
|
||
{
|
||
name: '强度',
|
||
path: '/product/strength',
|
||
component: './Product/Strength',
|
||
},
|
||
{
|
||
name: '口味',
|
||
path: '/product/flavors',
|
||
component: './Product/Flavors',
|
||
},
|
||
{
|
||
name: '产品列表',
|
||
path: '/product/list',
|
||
component: './Product/List',
|
||
},
|
||
{
|
||
name: 'WP商品列表',
|
||
path: '/product/wp_list',
|
||
component: './Product/WpList',
|
||
},
|
||
],
|
||
},
|
||
{
|
||
name: '库存管理',
|
||
path: '/stock',
|
||
access: 'canSeeStock',
|
||
routes: [
|
||
{
|
||
name: '库存列表',
|
||
path: '/stock/list',
|
||
component: './Stock/List',
|
||
},
|
||
{
|
||
name: '仓库点',
|
||
path: '/stock/warehouse',
|
||
component: './Stock/Warehouse',
|
||
},
|
||
{
|
||
name: '采购管理',
|
||
path: '/stock/purchaseOrder',
|
||
component: './Stock/PurchaseOrder',
|
||
},
|
||
{
|
||
name: '发货管理',
|
||
path: '/stock/transfer',
|
||
component: './Stock/Transfer',
|
||
},
|
||
{
|
||
name: '库存记录',
|
||
path: '/stock/record',
|
||
component: './Stock/Record',
|
||
},
|
||
],
|
||
},
|
||
{
|
||
name: '订单管理',
|
||
path: '/order',
|
||
access: 'canSeeOrder',
|
||
routes: [
|
||
{
|
||
name: '订单列表',
|
||
path: '/order/list',
|
||
component: './Order/List',
|
||
},
|
||
{
|
||
name: '待发货产品',
|
||
path: '/order/item',
|
||
component: './Order/PendingItems',
|
||
},
|
||
],
|
||
},
|
||
// 新增:订阅管理路由分组(权限复用 canSeeOrder)
|
||
{
|
||
name: '订阅管理',
|
||
path: '/subscription',
|
||
access: 'canSeeOrder',
|
||
routes: [
|
||
{
|
||
name: '订阅列表',
|
||
path: '/subscription/list',
|
||
component: './Subscription/List',
|
||
},
|
||
{
|
||
name: '订单管理',
|
||
path: '/subscription/orders',
|
||
component: './Subscription/Orders',
|
||
},
|
||
],
|
||
},
|
||
{
|
||
name: '客户管理',
|
||
path: '/customer',
|
||
access: 'canSeeCustomer',
|
||
routes: [
|
||
{
|
||
name: '客户列表',
|
||
path: '/customer/list',
|
||
component: './Customer/List',
|
||
},
|
||
],
|
||
},
|
||
{
|
||
name: '物流管理',
|
||
path: '/logistics',
|
||
access: 'canSeeLogistics',
|
||
routes: [
|
||
{
|
||
name: '服务商',
|
||
path: '/logistics/services',
|
||
component: './Logistics/Services',
|
||
},
|
||
{
|
||
name: '地址管理',
|
||
path: '/logistics/address',
|
||
component: './Logistics/Address',
|
||
},
|
||
{
|
||
name: '物流列表',
|
||
path: '/logistics/list',
|
||
component: './Logistics/List',
|
||
},
|
||
],
|
||
},
|
||
{
|
||
name: '数据统计',
|
||
path: '/statistics',
|
||
access: 'canSeeStatistics',
|
||
routes: [
|
||
{
|
||
name: '销售统计',
|
||
path: '/statistics/sales',
|
||
component: './Statistics/Sales',
|
||
},
|
||
{
|
||
name: '订单统计',
|
||
path: '/statistics/order',
|
||
component: './Statistics/Order',
|
||
},
|
||
{
|
||
name: '订单来源',
|
||
path: '/statistics/orderSource',
|
||
component: './Statistics/OrderSource',
|
||
},
|
||
{
|
||
name: '客户统计',
|
||
path: '/statistics/customer',
|
||
component: './Statistics/Customer',
|
||
},
|
||
{
|
||
name: '库存预测',
|
||
path: '/statistics/inventoryForecast',
|
||
component: './Statistics/InventoryForecast',
|
||
},
|
||
{
|
||
name: '补货',
|
||
path: '/statistics/restocking',
|
||
component: './Statistics/Restocking',
|
||
},
|
||
],
|
||
},
|
||
// {
|
||
// path: '*',
|
||
// component: './404',
|
||
// },
|
||
],
|
||
npmClient: 'pnpm',
|
||
});
|