123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463 |
- import defaultSettings from './defaultSettings'; // https://umijs.org/config/
-
- import slash from 'slash2';
- import webpackPlugin from './plugin.config';
- const { pwa, primaryColor } = defaultSettings; // preview.pro.ant.design only do not use in your production ;
- // preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
-
- const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env;
- const isAntDesignProPreview = ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site';
- const plugins = [
- [
- 'umi-plugin-react',
- {
- antd: true,
- dva: {
- hmr: true,
- },
- locale: {
- // default false
- enable: true,
- // default zh-CN
- default: 'zh-CN',
- // default true, when it is true, will use `navigator.language` overwrite default
- baseNavigator: true,
- },
- dynamicImport: {
- loadingComponent: './components/PageLoading/index',
- webpackChunkName: true,
- level: 3,
- },
- pwa: pwa
- ? {
- workboxPluginMode: 'InjectManifest',
- workboxOptions: {
- importWorkboxFrom: 'local',
- },
- }
- : false, // default close dll, because issue https://github.com/ant-design/ant-design-pro/issues/4665
- // dll features https://webpack.js.org/plugins/dll-plugin/
- // dll: {
- // include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'],
- // exclude: ['@babel/runtime', 'netlify-lambda'],
- // },
- },
- ],
- [
- 'umi-plugin-pro-block',
- {
- moveMock: false,
- moveService: false,
- modifyRequest: true,
- autoAddMenu: true,
- },
- ],
- ]; // 针对 preview.pro.ant.design 的 GA 统计代码
-
- if (isAntDesignProPreview) {
- plugins.push([
- 'umi-plugin-ga',
- {
- code: 'UA-72788897-6',
- },
- ]);
- plugins.push([
- 'umi-plugin-pro',
- {
- serverUrl: 'https://ant-design-pro.netlify.com',
- },
- ]);
- }
-
- export default {
- plugins,
- block: {
- // 国内用户可以使用码云
- // defaultGitUrl: 'https://gitee.com/ant-design/pro-blocks',
- defaultGitUrl: 'https://github.com/ant-design/pro-blocks',
- },
- hash: true,
- targets: {
- ie: 11,
- },
- devtool: isAntDesignProPreview ? 'source-map' : false,
- // umi routes: https://umijs.org/zh/guide/router.html
- routes: [
- {
- path: '/user',
- component: '../layouts/UserLayout',
- routes: [
- {
- name: 'login',
- path: '/user/login',
- component: './user/login',
- },
- ],
- },
- {
- path: '/',
- component: '../layouts/SecurityLayout',
- routes: [
- {
- path: '/',
- component: '../layouts/BasicLayout',
- authority: ['admin', 'user'],
- routes: [
- {
- path: '/',
- redirect: '/welcome',
- },
- {
- path: '/welcome',
- name: '首页',
- component: './Welcome',
- },
- {
- path: '/building',
- name: '项目管理',
- component: '../layouts/BlankLayout',
- routes: [
- {
- path: '/building/list',
- name: '项目列表',
- component: './building/list/index',
- },
- {
- path: '/building/list/add',
- name: '', // 项目添加
- component: './building/list/add/index',
- },
- {
- path: '/building/type',
- name: '项目类型',
- component: './building/type/index',
- },
- {
- path: '/building/type/edi',
- name: '',
- component: './building/type/edi',
- },
- ],
- },
- {
- path: '/customer',
- name: '客户管理',
- component: '../layouts/BlankLayout',
- routes: [
- {
- path: '/customer/customerlist/list',
- name: '客户列表',
- component: './customer/customerlist/index',
- },
- {
- path: '/customer/customerlist/customerDetail',
- name: '',
- component: './customer/customerlist/customerDetail',
- },
- {
- path: '/customer/drift/list',
- name: '游客列表',
- component: './customer/drift/index',
- },
- {
- path: '/customer/report/list',
- name: '报备客户',
- component: './customer/report/index',
- },
- {
- path: '/customer/recommendCustomer/list',
- name: '推荐客户',
- component: './customer/recommendCustomer/index',
- },
- {
- path: '/customer/recommendCustomer/audit',
- name: '', //审核
- component: './customer/recommendCustomer/audit',
- },
- {
- path: '/customer/independentList',
- name: '经纪人',
- component: './customer/independentList/index',
- },
- ],
- },
- {
- path: '/integralMall',
- name: '积分商城',
- component: '../layouts/BlankLayout',
- routes: [
- {
- path: '/integralMall/GoodsList',
- name: '商品列表',
- component: './integralMall/GoodsList',
- },
- {
- path: '/integralMall/achieve',
- name: '积分获取',
- component: './integralMall/achieve',
- },
- {
- path: '/integralMall/editGoods',
- name: '',
- component: './integralMall/editGoods',
- },
- {
- path: '/integralMall/exchangeRecords',
- name: '兑换记录',
- component: './integralMall/exchangeRecords',
- },
- {
- path: '/integralMall/writeOff',
- name: '商品核销',
- component: './integralMall/writeOff',
- },
- {
- path: '/integralMall/verifyList',
- name: '',
- component: './integralMall/verifyList',
- },
- ],
- },
- {
- path: '/channel',
- name: '渠道管理',
- component: '../layouts/BlankLayout',
- routes: [
- {
- path: '/channel/channelList',
- name: '渠道管理',
- component: './channel/channelList',
- },
- {
- path: '/channel/addChannel',
- name: '',
- component: './channel/addChannel',
- },
- {
- path: '/channel/editChannel',
- name: '',
- component: './channel/editChannel',
- },
- {
- path: '/channel/brokerList',
- name: '经纪人',
- component: './channel/brokerList',
- },
- {
- path: '/channel/recommendClients',
- name: '',
- component: './channel/recommendClients',
- },
- {
- path: '/channel/InviteClients',
- name: '',
- component: './channel/InviteClients',
- },
- ],
- },
- {
- path: '/news',
- name: '资讯管理',
- component: '../layouts/BlankLayout',
- routes: [
- {
- path: '/news/type/NewsType',
- name: '资讯类型',
- component: './news/type/NewsType',
- },
- {
- path: '/news/type/editNews',
- name: '',
- component: './news/type/editNews',
- },
- {
- path: '/news/list/NewsList',
- name: '资讯列表',
- component: './news/list/NewsList',
- },
- {
- path: '/news/list/editNewsList',
- name: '',
- component: './news/list/editNewsList',
- },
- ],
- },
- {
- path: '/activity',
- name: '活动管理',
- component: '../layouts/BlankLayout',
- routes: [
- {
- path: '/activity/ActivityList',
- name: '活动列表',
- component: './activity/ActivityList',
- },
- {
- path: '/activity/editActivity',
- name: '',
- component: './activity/editActivity',
- },
- {
- path: '/activity/SignList',
- name: '',
- component: './activity/SignList',
- },
- ],
- },
- {
- path: '/staff',
- name: '员工管理',
- component: '../layouts/BlankLayout',
- routes: [
- {
- path: '/staff/StaffList',
- name: '员工列表',
- component: './staff/list/StaffList',
- },
- {
- path: '/staff/editStaff',
- name: '',
- component: './staff/list/editStaff',
- },
-
- {
- path: '/staff/RoleList',
- name: '角色管理',
- component: './staff/list/RoleList',
- },
- {
- path: '/staff/editRole',
- name: '',
- component: './staff/list/editRole',
- },
-
- ],
- },
- {
- path: '/carouselFigure',
- name: '轮播图管理',
- component: '../layouts/BlankLayout',
- routes: [
- {
- path: '/carouselFigure/carouselFigureList',
- name: '轮播图列表',
- component: './carouselFigure/carouselFigureList',
- },
- {
- path: '/carouselFigure/editCarousel',
- name: '',
- component: './carouselFigure/editCarousel',
- },
- {
- path: '/carouselFigure/advertisingList',
- name: '开屏广告',
- component: './carouselFigure/advertisingList',
- },
- {
- path: '/carouselFigure/editAdvertising',
- name: '',
- component: './carouselFigure/editAdvertising',
- },
- ],
- },
- {
- path: '/system',
- name: '系统管理',
- component: '../layouts/BlankLayout',
- routes: [
- {
- path: '/system/messageList',
- name: '客户留言',
- component: './system/messageList',
- },
- {
- path: '/system/report',
- name: '报表数据',
- component: './system/report',
- },
- {
- path: '/system/intention',
- name: '意向值',
- component: './system/intention',
- },
- {
- path: '/system/housingPolicy',
- name: '购房政策维护',
- component: './system/housingPolicy',
- },
- {
- path: '/system/editPolicy',
- name: '',
- component: './system/editPolicy',
- },
- ],
- },
- {
- component: './404',
- },
- ],
- },
- {
- component: './404',
- },
- ],
- },
- {
- component: './404',
- },
- ],
- // Theme for antd: https://ant.design/docs/react/customize-theme-cn
- theme: {
- 'primary-color': primaryColor,
- 'btn-primary-bg': '#EF273A',
- 'table-row-hover-bg': '#eee',
- 'btn-danger-bg': '#FF7E48',
-
- },
- define: {
- ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION:
- ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION || '', // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
- },
- ignoreMomentLocale: true,
- lessLoaderOptions: {
- javascriptEnabled: true,
- },
- disableRedirectHoist: true,
- cssLoaderOptions: {
- modules: true,
- getLocalIdent: (context, _, localName) => {
- if (
- context.resourcePath.includes('node_modules') ||
- context.resourcePath.includes('ant.design.pro.less') ||
- context.resourcePath.includes('global.less')
- ) {
- return localName;
- }
-
- const match = context.resourcePath.match(/src(.*)/);
-
- if (match && match[1]) {
- const antdProPath = match[1].replace('.less', '');
- const arr = slash(antdProPath)
- .split('/')
- .map(a => a.replace(/([A-Z])/g, '-$1'))
- .map(a => a.toLowerCase());
- return `antd-pro${arr.join('-')}-${localName}`.replace(/--/g, '-');
- }
-
- return localName;
- },
- },
- manifest: {
- basePath: '/',
- },
- chainWebpack: webpackPlugin,
-
- proxy: {
- '/api/': {
- target: 'http://192.168.0.84:8080/',
- changeOrigin: true,
- // pathRewrite: { '^/server': '' },
- },
- },
- };
|