219 lines
5.5 KiB
TypeScript
219 lines
5.5 KiB
TypeScript
/**
|
|
* @name umi routing configuration
|
|
* @description Only supports path, component, routes, redirect, wrappers, name, icon configuration
|
|
* @param path path only supports two placeholder configurations. The first is in the form of dynamic parameter :id, and the second is the *wildcard character. The wildcard character can only appear at the end of the routing string.
|
|
* @param component Configure the React component path used for rendering after location and path match. It can be an absolute path or a relative path. If it is a relative path, it will be searched starting from src/pages.
|
|
* @param routes Configure sub-routes, usually used when you need to add layout components to multiple paths.
|
|
* @param redirect Configure route jump
|
|
* @param wrappers Configure the packaging component of the routing component. Through the packaging component, you can combine more functions into the current routing component. For example, it can be used for routing-level permission verification.
|
|
* @param name Configure the title of the route. By default, the value of menu.xxxx in the internationalization file menu.ts is read. If the name is configured as login, the value of menu.login in menu.ts is read as the title.
|
|
* @param icon Configure the icon of the route. For the value, refer to https://ant.design/components/icon-cn. Pay attention to removing the style suffix and capitalization. If you want to configure the icon to be <StepBackwardOutlined />, the value should be stepBackward or StepBackward. If you want to configure the icon to be <UserOutlined />, the value should be user or User.
|
|
* @doc https://umijs.org/docs/guides/routes
|
|
*/
|
|
export const commonRoutes = [
|
|
{
|
|
path: '/login',
|
|
layout: false,
|
|
component: './login',
|
|
// wrappers: ['@/wrappers/authRedirect'],
|
|
},
|
|
{
|
|
path: '/',
|
|
redirect: '/dashboard',
|
|
},
|
|
{
|
|
path: '*',
|
|
layout: false,
|
|
component: './404',
|
|
},
|
|
];
|
|
export const roleRoutes = [
|
|
{
|
|
path: '/dashboard',
|
|
name: 'dashboard',
|
|
icon: '📊',
|
|
access: 'normalRouteFilter',
|
|
meta: {
|
|
permissions: ['dashboard:list'],
|
|
},
|
|
component: './dashboard',
|
|
},
|
|
{
|
|
path: '/profile',
|
|
name: 'profile',
|
|
hideInMenu: true,
|
|
component: './profile',
|
|
},
|
|
{
|
|
path: '/rules',
|
|
name: 'rules',
|
|
icon: '⚙️',
|
|
access: 'normalRouteFilter',
|
|
meta: {
|
|
permissions: ['rule:list'],
|
|
},
|
|
wrappers: ['@/wrappers/noBindDataSource'],
|
|
component: './rules',
|
|
routes: [
|
|
{
|
|
path: 'large-trade-lots',
|
|
name: 'largeTradeLots',
|
|
ruleType: '1',
|
|
},
|
|
{
|
|
path: 'large-trade-usd',
|
|
name: 'largeTradeUSD',
|
|
ruleType: '2',
|
|
},
|
|
{
|
|
path: 'liquidity-trade',
|
|
name: 'liquidityTrade',
|
|
ruleType: '3',
|
|
},
|
|
{
|
|
path: 'scalping',
|
|
name: 'scalping',
|
|
ruleType: '4',
|
|
},
|
|
{
|
|
path: 'exposure-alert',
|
|
name: 'exposureAlert',
|
|
ruleType: '5',
|
|
},
|
|
// {
|
|
// path: 'pricing-volatility',
|
|
// name: 'pricingVolatility',
|
|
// ruleType: '6',
|
|
// },
|
|
{
|
|
path: 'pricing',
|
|
name: 'pricing',
|
|
ruleType: '6',
|
|
},
|
|
{
|
|
path: 'volatility',
|
|
name: 'volatility',
|
|
ruleType: '11',
|
|
},
|
|
{
|
|
path: 'nop-limit',
|
|
name: 'NOPLimit',
|
|
ruleType: '7',
|
|
},
|
|
{
|
|
path: 'watch-list',
|
|
name: 'watchList',
|
|
ruleType: '8',
|
|
},
|
|
{
|
|
path: 'reverse-positions',
|
|
name: 'reversePositions',
|
|
ruleType: '9',
|
|
},
|
|
{
|
|
path: 'deposit-withdrawal',
|
|
name: 'depositWithdrawal',
|
|
ruleType: '10',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/products',
|
|
name: 'products',
|
|
icon: '📦',
|
|
access: 'normalRouteFilter',
|
|
meta: {
|
|
permissions: ['product:list'],
|
|
},
|
|
wrappers: ['@/wrappers/noBindDataSource'],
|
|
component: './products/index',
|
|
},
|
|
{
|
|
path: '/alert',
|
|
name: 'alert',
|
|
icon: '🔔',
|
|
access: 'normalRouteFilter',
|
|
meta: {
|
|
permissions: ['alert:list'],
|
|
},
|
|
component: './alert/index',
|
|
},
|
|
{
|
|
path: '/account',
|
|
name: 'account',
|
|
icon: '👥',
|
|
access: 'normalRouteFilter',
|
|
meta: {
|
|
permissions: ['account:list'],
|
|
},
|
|
component: './account/index',
|
|
},
|
|
{
|
|
path: '/company',
|
|
name: 'company',
|
|
icon: '🏢',
|
|
access: 'normalRouteFilter',
|
|
meta: {
|
|
permissions: ['company:list'],
|
|
},
|
|
component: './company/index',
|
|
},
|
|
{
|
|
path: '/data-source',
|
|
name: 'dataSource',
|
|
icon: '🔌',
|
|
access: 'normalRouteFilter',
|
|
meta: {
|
|
permissions: ['data-source:list'],
|
|
},
|
|
component: './data-source/index',
|
|
},
|
|
{
|
|
path: '/user',
|
|
name: 'user',
|
|
icon: '👤',
|
|
access: 'normalRouteFilter',
|
|
meta: {
|
|
permissions: ['user:list'],
|
|
},
|
|
component: './user/index',
|
|
},
|
|
{
|
|
path: '/role',
|
|
name: 'role',
|
|
icon: '🔐',
|
|
access: 'normalRouteFilter',
|
|
meta: {
|
|
permissions: ['role:list'],
|
|
},
|
|
component: './role/index',
|
|
},
|
|
{
|
|
path: '/config',
|
|
name: 'config',
|
|
icon: '🔧',
|
|
access: 'normalRouteFilter',
|
|
meta: {
|
|
permissions: ['config:list'],
|
|
},
|
|
component: './config/index',
|
|
},
|
|
{
|
|
path: '/email-services',
|
|
name: 'emailServices',
|
|
icon: '📧',
|
|
access: 'isGlobalCompany',
|
|
component: './email-services/index',
|
|
},
|
|
{
|
|
path: '/oper-log',
|
|
name: 'operLog',
|
|
icon: '📜',
|
|
access: 'normalRouteFilter',
|
|
meta: {
|
|
permissions: ['oper:log:list'],
|
|
},
|
|
component: './oper-log/index',
|
|
},
|
|
];
|