You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
417 lines
9.9 KiB
417 lines
9.9 KiB
// https://umijs.org/config/
|
|
import { defineConfig } from 'umi';
|
|
import { join } from 'path';
|
|
import defaultSettings from './defaultSettings';
|
|
import proxy from './proxy';
|
|
const { REACT_APP_ENV } = process.env;
|
|
export default defineConfig({
|
|
history: {
|
|
type: 'hash'
|
|
},
|
|
hash: true,
|
|
antd: {},
|
|
dva: {
|
|
hmr: true,
|
|
},
|
|
layout: {
|
|
// https://umijs.org/zh-CN/plugins/plugin-layout
|
|
locale: true,
|
|
siderWidth: 208,
|
|
...defaultSettings,
|
|
},
|
|
// https://umijs.org/zh-CN/plugins/plugin-locale
|
|
locale: {
|
|
// default zh-CN
|
|
default: 'zh-CN',
|
|
antd: true,
|
|
// default true, when it is true, will use `navigator.language` overwrite default
|
|
baseNavigator: true,
|
|
},
|
|
dynamicImport: {
|
|
loading: '@ant-design/pro-layout/es/PageLoading',
|
|
},
|
|
targets: {
|
|
ie: 11,
|
|
},
|
|
// umi routes: https://umijs.org/docs/routing
|
|
routes: [
|
|
{
|
|
path: '/user',
|
|
layout: false,
|
|
routes: [
|
|
{
|
|
path: '/user/login',
|
|
layout: false,
|
|
name: 'login',
|
|
component: './user/Login',
|
|
},
|
|
{
|
|
path: '/user',
|
|
redirect: '/user/login',
|
|
},
|
|
{
|
|
name: 'register-result',
|
|
icon: 'smile',
|
|
path: '/user/register-result',
|
|
component: './user/register-result',
|
|
},
|
|
{
|
|
name: 'register',
|
|
icon: 'smile',
|
|
path: '/user/register',
|
|
component: './user/register',
|
|
},
|
|
{
|
|
component: '404',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/dashboard',
|
|
name: '生涯课程中心',
|
|
icon: 'home',
|
|
component: './dashboard/analysis',
|
|
},
|
|
{
|
|
path: '/course',
|
|
icon: 'table',
|
|
name: '课程管理',
|
|
routes: [
|
|
{
|
|
name: '主题设置',
|
|
icon: 'smile',
|
|
path: '/course/subject',
|
|
component: './course/subject',
|
|
},
|
|
{
|
|
name: '新建主题',
|
|
icon: 'smile',
|
|
path: '/course/subject/step/update/',
|
|
component: './course/subject/step',
|
|
hideInMenu: true,
|
|
},
|
|
{
|
|
name: '编辑主题',
|
|
icon: 'smile',
|
|
path: '/course/subject/step/update/:id',
|
|
component: './course/subject/step',
|
|
hideInMenu: true,
|
|
},
|
|
{
|
|
name: '编辑主题',
|
|
icon: 'smile',
|
|
path: '/course/subject/step/create',
|
|
component: './course/subject/step',
|
|
hideInMenu: true,
|
|
},
|
|
{
|
|
name: '课程设置',
|
|
icon: 'smile',
|
|
path: '/course/option',
|
|
component: './course/option',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/training',
|
|
icon: 'table',
|
|
name: '培训管理',
|
|
component: './training/option',
|
|
},
|
|
|
|
{
|
|
path: '/questionbank',
|
|
icon: 'table',
|
|
name: '题库维护',
|
|
routes: [
|
|
{
|
|
name: '常规题库维护',
|
|
icon: 'smile',
|
|
path: '/questionbank/normal',
|
|
component: './questionbank/normal',
|
|
},
|
|
{
|
|
name: '资质考试题库维护',
|
|
icon: 'smile',
|
|
path: '/questionbank/attestation',
|
|
component: './questionbank/attestation',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/examinationrules',
|
|
icon: 'table',
|
|
name: '考试规则维护',
|
|
routes: [
|
|
{
|
|
name: '模拟考试规则维护',
|
|
icon: 'smile',
|
|
path: '/examinationrules/normal',
|
|
component: './examinationrules/normal',
|
|
},
|
|
{
|
|
name: '创建模拟考试规则',
|
|
icon: 'smile',
|
|
path: '/examinationrules/normal/step',
|
|
component: './examinationrules/normal/step',
|
|
hideInMenu: true,
|
|
},
|
|
{
|
|
name: '编辑模拟考试规则',
|
|
icon: 'smile',
|
|
path: '/examinationrules/normal/step/:id',
|
|
component: './examinationrules/normal/step',
|
|
hideInMenu: true,
|
|
},
|
|
{
|
|
name: '资质考试规则维护',
|
|
icon: 'smile',
|
|
path: '/examinationrules/attestation',
|
|
component: './examinationrules/attestation',
|
|
},
|
|
{
|
|
name: '创建资质考试规则维护',
|
|
icon: 'smile',
|
|
path: '/examinationrules/attestation/step',
|
|
component: './examinationrules/attestation/step',
|
|
hideInMenu: true,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/examination',
|
|
name: '考试管理',
|
|
icon: 'profile',
|
|
routes: [
|
|
{
|
|
name: '考试维护',
|
|
path: '/examination/option',
|
|
component: './examination/option',
|
|
},
|
|
{
|
|
name: '报名管理',
|
|
icon: 'smile',
|
|
path: '/examination/option/registration/:id',
|
|
component: './examination/registration',
|
|
hideInMenu: true,
|
|
},
|
|
{
|
|
name: '制证管理',
|
|
icon: 'smile',
|
|
path: '/examination/certificate',
|
|
component: './examination/certificate',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/history',
|
|
icon: 'table',
|
|
name: '生涯考试历史',
|
|
routes: [
|
|
{
|
|
name: '历史统计',
|
|
icon: 'smile',
|
|
path: '/history/analysis',
|
|
component: './history/analysis',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/demo',
|
|
icon: 'table',
|
|
name: 'demo',
|
|
component: './demo',
|
|
hideInMenu: true,
|
|
},
|
|
{
|
|
path: '/list',
|
|
icon: 'table',
|
|
name: 'list',
|
|
hideInMenu: true,
|
|
routes: [
|
|
{
|
|
path: '/list/search',
|
|
name: 'search-list',
|
|
component: './list/search',
|
|
routes: [
|
|
{
|
|
path: '/list/search',
|
|
redirect: '/list/search/articles',
|
|
},
|
|
{
|
|
name: 'articles',
|
|
icon: 'smile',
|
|
path: '/list/search/articles',
|
|
component: './list/search/articles',
|
|
},
|
|
{
|
|
name: 'projects',
|
|
icon: 'smile',
|
|
path: '/list/search/projects',
|
|
component: './list/search/projects',
|
|
},
|
|
{
|
|
name: 'applications',
|
|
icon: 'smile',
|
|
path: '/list/search/applications',
|
|
component: './list/search/applications',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/list',
|
|
redirect: '/list/table-list',
|
|
},
|
|
{
|
|
name: 'table-list',
|
|
icon: 'smile',
|
|
path: '/list/table-list',
|
|
component: './list/table-list',
|
|
},
|
|
{
|
|
name: 'basic-list',
|
|
icon: 'smile',
|
|
path: '/list/basic-list',
|
|
component: './list/basic-list',
|
|
},
|
|
{
|
|
name: 'card-list',
|
|
icon: 'smile',
|
|
path: '/list/card-list',
|
|
component: './list/card-list',
|
|
},
|
|
{
|
|
name: '查询表格2',
|
|
icon: 'smile',
|
|
path: '/list/listtablelist2',
|
|
component: './ListTableList2',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/profile',
|
|
name: 'profile',
|
|
icon: 'profile',
|
|
hideInMenu: true,
|
|
routes: [
|
|
{
|
|
path: '/profile',
|
|
redirect: '/profile/basic',
|
|
},
|
|
{
|
|
name: 'basic',
|
|
icon: 'smile',
|
|
path: '/profile/basic',
|
|
component: './profile/basic',
|
|
},
|
|
{
|
|
name: 'advanced',
|
|
icon: 'smile',
|
|
path: '/profile/advanced',
|
|
component: './profile/advanced',
|
|
},
|
|
],
|
|
},
|
|
|
|
{
|
|
name: 'exception',
|
|
icon: 'warning',
|
|
path: '/exception',
|
|
hideInMenu: true,
|
|
routes: [
|
|
{
|
|
path: '/exception',
|
|
redirect: '/exception/403',
|
|
},
|
|
{
|
|
name: '403',
|
|
icon: 'smile',
|
|
path: '/exception/403',
|
|
component: './exception/403',
|
|
},
|
|
{
|
|
name: '404',
|
|
icon: 'smile',
|
|
path: '/exception/404',
|
|
component: './exception/404',
|
|
},
|
|
{
|
|
name: '500',
|
|
icon: 'smile',
|
|
path: '/exception/500',
|
|
component: './exception/500',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: '账号信息',
|
|
icon: 'user',
|
|
path: '/account',
|
|
hideInMenu: true,
|
|
routes: [
|
|
{
|
|
path: '/account',
|
|
redirect: '/account/center',
|
|
},
|
|
{
|
|
name: '个人中心',
|
|
icon: 'smile',
|
|
path: '/account/center',
|
|
component: './account/center',
|
|
},
|
|
{
|
|
name: '个人设置',
|
|
icon: 'smile',
|
|
path: '/account/settings',
|
|
component: './account/settings',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/',
|
|
redirect: '/dashboard',
|
|
},
|
|
{
|
|
component: '404',
|
|
},
|
|
],
|
|
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
|
|
theme: {
|
|
'primary-color': defaultSettings.primaryColor,
|
|
'primary-color-hover': defaultSettings.primaryColor,
|
|
},
|
|
// esbuild is father build tools
|
|
// https://umijs.org/plugins/plugin-esbuild
|
|
esbuild: {},
|
|
title: false,
|
|
ignoreMomentLocale: true,
|
|
proxy: proxy[REACT_APP_ENV || 'dev'],
|
|
base: '/',
|
|
publicPath: './', // 发布路径采用相对地址
|
|
manifest: {
|
|
basePath: './',
|
|
},
|
|
// Fast Refresh 热更新
|
|
fastRefresh: {},
|
|
openAPI: [
|
|
{
|
|
requestLibPath: "import { request } from 'umi'",
|
|
// 或者使用在线的版本
|
|
// schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
|
|
schemaPath: join(__dirname, 'oneapi.json'),
|
|
mock: false,
|
|
},
|
|
{
|
|
requestLibPath: "import { request } from 'umi'",
|
|
schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
|
|
projectName: 'swagger',
|
|
},
|
|
],
|
|
nodeModulesTransform: {
|
|
type: 'none',
|
|
},
|
|
mfsu: {},
|
|
webpack5: {},
|
|
exportStatic: {},
|
|
});
|