Commit a5fdbf8e authored by duanledexianxianxian's avatar duanledexianxianxian

Merge remote-tracking branch 'github/master' into master-kim-1

# Conflicts:
#	.eslintrc.js
#	config/config.ts
#	package.json
#	src/components/GlobalHeader/RightContent.tsx
#	src/layouts/BasicLayout.tsx
#	src/layouts/UserLayout.tsx
#	src/models/user.ts
parents b5cb5b84 e14b1311
import { IConfig, IPlugin } from 'umi-types'; import { IConfig, IPlugin } from 'umi-types';
import defaultSettings from './defaultSettings'; // https://umijs.org/config/
import defaultSettings from './defaultSettings';
// https://umijs.org/config/
import slash from 'slash2'; import slash from 'slash2';
import webpackPlugin from './plugin.config'; import webpackPlugin from './plugin.config';
import theme from './theme.config';
const path = require('path');
const { pwa } = defaultSettings; // preview.pro.ant.design only do not use in your production ; const { pwa, primaryColor } = defaultSettings;
// preview.pro.ant.design only do not use in your production ;
// preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 // preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env; const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env;
...@@ -40,6 +42,8 @@ const plugins: IPlugin[] = [ ...@@ -40,6 +42,8 @@ const plugins: IPlugin[] = [
}, },
} }
: false, : 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: { // dll: {
// include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'], // include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'],
// exclude: ['@babel/runtime', 'netlify-lambda'], // exclude: ['@babel/runtime', 'netlify-lambda'],
...@@ -87,232 +91,15 @@ export default { ...@@ -87,232 +91,15 @@ export default {
routes: [ routes: [
{ {
path: '/', path: '/',
component: '../layouts/BlankLayout', component: '../layouts/BasicLayout',
Routes: ['src/pages/Authorized'],
authority: ['admin', 'user'],
routes: [ routes: [
{
path: '/404',
component: './404',
},
{
path: '/user',
component: '../layouts/UserLayout',
routes: [
{
path: '/user',
redirect: '/user/login',
},
{
name: 'login',
path: '/user/login',
component: './user/login',
},
],
},
{ {
path: '/', path: '/',
component: '../layouts/BasicLayout', name: 'welcome',
Routes: ['src/pages/Authorized'], icon: 'smile',
authority: ['user'], component: './Welcome',
routes: [
{
path: '/',
redirect: '/dashboard/analysis',
},
{
path: '/dashboard',
name: 'dashboard',
icon: 'dashboard',
routes: [
{
name: 'analysis',
path: '/dashboard/analysis',
component: './dashboard/analysis',
},
{
name: 'monitor',
path: '/dashboard/monitor',
component: './dashboard/monitor',
},
{
name: 'workplace',
path: '/dashboard/workplace',
component: './dashboard/workplace',
},
],
},
{
path: '/form',
icon: 'form',
name: 'form',
routes: [
{
name: 'basic-form',
path: '/form/basic-form',
component: './form/basic-form',
},
{
name: 'step-form',
path: '/form/step-form',
component: './form/step-form',
},
{
name: 'advanced-form',
path: '/form/advanced-form',
component: './form/advanced-form',
},
],
},
{
path: '/list',
icon: 'table',
name: 'list',
routes: [
{
path: '/list/search',
name: 'search-list',
component: './list/search',
routes: [
{
path: '/list/search',
redirect: '/list/search/articles',
},
{
name: 'articles',
path: '/list/search/articles',
component: './list/search/articles',
},
{
name: 'projects',
path: '/list/search/projects',
component: './list/search/projects',
},
{
name: 'applications',
path: '/list/search/applications',
component: './list/search/applications',
},
],
},
{
name: 'table-list',
path: '/list/table-list',
component: './list/table-list',
},
{
name: 'basic-list',
path: '/list/basic-list',
component: './list/basic-list',
},
{
name: 'card-list',
path: '/list/card-list',
component: './list/card-list',
},
],
},
{
path: '/profile',
name: 'profile',
icon: 'profile',
routes: [
{
name: 'basic',
path: '/profile/basic',
component: './profile/basic',
},
{
name: 'advanced',
path: '/profile/advanced',
component: './profile/advanced',
},
],
},
{
name: 'result',
icon: 'check-circle-o',
path: '/result',
routes: [
{
name: 'success',
path: '/result/success',
component: './result/success',
},
{
name: 'fail',
path: '/result/fail',
component: './result/fail',
},
],
},
{
name: 'exception',
icon: 'warning',
path: '/exception',
routes: [
{
name: '403',
path: '/exception/403',
component: './exception/403',
},
{
name: '404',
path: '/exception/404',
component: './exception/404',
},
{
name: '500',
path: '/exception/500',
component: './exception/500',
},
],
},
{
name: 'account',
icon: 'user',
path: '/account',
routes: [
{
name: 'center',
path: '/account/center',
component: './account/center',
},
{
name: 'settings',
path: '/account/settings',
component: './account/settings',
},
],
},
{
name: 'editor',
icon: 'highlight',
path: '/editor',
routes: [
{
name: 'flow',
path: '/editor/flow',
component: './editor/flow',
},
{
name: 'mind',
path: '/editor/mind',
component: './editor/mind',
},
{
name: 'koni',
path: '/editor/koni',
component: './editor/koni',
},
],
},
{
name: 'parameter',
icon: 'highlight',
path: '/parameter',
component: './system/parameter',
authority: ['user'],
},
],
}, },
{ {
component: './404', component: './404',
...@@ -323,9 +110,10 @@ export default { ...@@ -323,9 +110,10 @@ export default {
component: './404', component: './404',
}, },
], ],
// Theme for antd // Theme for antd: https://ant.design/docs/react/customize-theme-cn
// https://ant.design/docs/react/customize-theme-cn theme: {
theme, 'primary-color': primaryColor,
},
define: { define: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: 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 专用环境变量,请不要在你的项目中使用它。 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 专用环境变量,请不要在你的项目中使用它。
...@@ -370,16 +158,6 @@ export default { ...@@ -370,16 +158,6 @@ export default {
basePath: '/', basePath: '/',
}, },
chainWebpack: webpackPlugin, chainWebpack: webpackPlugin,
// 配置 webpack 的 resolve.alias 属性 默认src=>@
alias: {
src: path.join(__dirname, '../src'),
components: path.join(__dirname, '../src', 'components'),
utils: path.join(__dirname, '../src', 'utils'),
assets: path.join(__dirname, '../src', 'assets'),
themes: path.join(__dirname, '../src', 'themes'),
config: path.join(__dirname, '../src', '../config'),
public: path.join(__dirname, '../public'),
},
/* /*
proxy: { proxy: {
'/server/api/': { '/server/api/': {
......
...@@ -14,9 +14,8 @@ server { ...@@ -14,9 +14,8 @@ server {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
location /api { location /api {
proxy_pass https://preview.pro.ant.design; proxy_pass https://ant-design-pro.netlify.com;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
} }
} }
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
}, },
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "npm run lint-staged"
} }
}, },
"lint-staged": { "lint-staged": {
...@@ -53,7 +54,7 @@ ...@@ -53,7 +54,7 @@
"not ie <= 10" "not ie <= 10"
], ],
"dependencies": { "dependencies": {
"@ant-design/pro-layout": "^4.5.5", "@ant-design/pro-layout": "^4.5.7",
"@antv/data-set": "^0.10.2", "@antv/data-set": "^0.10.2",
"@types/lodash.debounce": "^4.0.6", "@types/lodash.debounce": "^4.0.6",
"@types/react-router": "^5.0.2", "@types/react-router": "^5.0.2",
...@@ -86,11 +87,12 @@ ...@@ -86,11 +87,12 @@
"react-media-hook2": "^1.0.5", "react-media-hook2": "^1.0.5",
"react-router": "^4.3.1", "react-router": "^4.3.1",
"redux": "^4.0.1", "redux": "^4.0.1",
"umi": "^2.7.2", "umi": "^2.8.7",
"umi-plugin-block-dev": "^1.0.0", "umi-plugin-block-dev": "^1.0.0",
"umi-plugin-ga": "^1.1.3", "umi-plugin-ga": "^1.1.3",
"umi-plugin-pro-block": "^1.3.2", "umi-plugin-pro-block": "^1.3.2",
"umi-plugin-react": "^1.8.2", "umi-plugin-react": "^1.9.5",
"umi-request": "^1.0.8",
"axios":"^0.19.0", "axios":"^0.19.0",
"query-string":"^6.8.1", "query-string":"^6.8.1",
"store":"^2.0.12" "store":"^2.0.12"
...@@ -129,6 +131,7 @@ ...@@ -129,6 +131,7 @@
"netlify-lambda": "^1.4.13", "netlify-lambda": "^1.4.13",
"node-fetch": "^2.6.0", "node-fetch": "^2.6.0",
"prettier": "^1.17.1", "prettier": "^1.17.1",
"pro-download": "1.0.1",
"serverless-http": "^2.0.2", "serverless-http": "^2.0.2",
"slash2": "^2.0.0", "slash2": "^2.0.0",
"stylelint": "^10.1.0", "stylelint": "^10.1.0",
......
import { Avatar, Icon, Menu, Spin } from 'antd'; import { Avatar, Icon, Menu, Spin } from 'antd';
import { ConnectProps, ConnectState } from '@/models/connect';
import { ClickParam } from 'antd/es/menu'; import { ClickParam } from 'antd/es/menu';
import { CurrentUser } from '@/models/user';
import { FormattedMessage } from 'umi-plugin-react/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import router from 'umi/router'; import router from 'umi/router';
import { ConnectProps, ConnectState } from '@/models/connect';
import { CurrentUser } from '@/models/user';
import HeaderDropdown from '../HeaderDropdown'; import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less'; import styles from './index.less';
......
import { ConnectProps, ConnectState } from '@/models/connect';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Tag, message } from 'antd'; import { Tag, message } from 'antd';
import { CurrentUser } from '@/models/user';
import NoticeIcon from '../NoticeIcon';
import { NoticeItem } from '@/models/global';
import { connect } from 'dva'; import { connect } from 'dva';
import { formatMessage } from 'umi-plugin-react/locale'; import { formatMessage } from 'umi-plugin-react/locale';
import groupBy from 'lodash/groupBy'; import groupBy from 'lodash/groupBy';
import moment from 'moment'; import moment from 'moment';
import { NoticeItem } from '@/models/global';
import NoticeIcon from '../NoticeIcon';
import { CurrentUser } from '@/models/user';
import { ConnectProps, ConnectState } from '@/models/connect';
import styles from './index.less'; import styles from './index.less';
export interface GlobalHeaderRightProps extends ConnectProps { export interface GlobalHeaderRightProps extends ConnectProps {
......
import { Effect } from './connect.d';
import { NoticeIconData } from '@/components/NoticeIcon';
import { Reducer } from 'redux'; import { Reducer } from 'redux';
import { Subscription } from 'dva'; import { Subscription } from 'dva';
import { Effect } from './connect.d';
import { NoticeIconData } from '@/components/NoticeIcon';
import { queryNotices } from '@/services/user'; import { queryNotices } from '@/services/user';
export interface NoticeItem extends NoticeIconData { export interface NoticeItem extends NoticeIconData {
......
import { Reducer } from 'redux'; import { Reducer } from 'redux';
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable promise/catch-or-return */
import { message } from 'antd'; import { message } from 'antd';
import defaultSettings, { DefaultSettings } from '../../config/defaultSettings'; import defaultSettings, { DefaultSettings } from '../../config/defaultSettings';
import themeColorClient from '../components/SettingDrawer/themeColorClient'; import themeColorClient from '../components/SettingDrawer/themeColorClient';
......
import { ConnectProps, ConnectState, Route, UserModelState } from '@/models/connect';
import Authorized from '@/utils/Authorized';
import React from 'react'; import React from 'react';
import Redirect from 'umi/redirect'; import Redirect from 'umi/redirect';
import { connect } from 'dva'; import { connect } from 'dva';
import pathToRegexp from 'path-to-regexp'; import pathToRegexp from 'path-to-regexp';
import Authorized from '@/utils/Authorized';
import { ConnectProps, ConnectState, Route, UserModelState } from '@/models/connect';
interface AuthComponentProps extends ConnectProps { interface AuthComponentProps extends ConnectProps {
user: UserModelState; user: UserModelState;
......
...@@ -12,7 +12,6 @@ declare module '*.jpeg'; ...@@ -12,7 +12,6 @@ declare module '*.jpeg';
declare module '*.gif'; declare module '*.gif';
declare module '*.bmp'; declare module '*.bmp';
declare module '*.tiff'; declare module '*.tiff';
declare module 'rc-animate';
declare module 'omit.js'; declare module 'omit.js';
declare module 'react-copy-to-clipboard'; declare module 'react-copy-to-clipboard';
declare module 'react-fittext'; declare module 'react-fittext';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment