From d1ce8e07397478741b38b99f09b5cdb92eb22315 Mon Sep 17 00:00:00 2001 From: Franco Laiuppa Date: Wed, 28 Nov 2018 16:53:25 +0100 Subject: [PATCH 1/6] Mini typo fixes Hi! Great project! I was reading the docs and noticed some typos regarding the layout names and the `exclude` parameter, so I've decided to fix it. I'm new to this repo so I hope this is a valid edit if not please let me know and I'll change it. Thanks! --- docs/configuration.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index c95e231..54acff7 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -12,7 +12,7 @@ You can do some custom configuration in `/src/utils/config.js`: - Type: `String` - Configure the copyright notice to apply to the login page, at the bottom of the `Primay` layout. + Configure the copyright notice to apply to the login page, at the bottom of the `Primary` layout. ## logoPath @@ -44,20 +44,20 @@ You can do some custom configuration in `/src/utils/config.js`: { name: 'primary', include: [/.*/], - exlude: [/(\/(en|zh))*\/login/], + exclude: [/(\/(en|zh))*\/login/], }, ], ``` The object properties for each layout are as follows: - - `name` - The name of the layout; + - `name` - The name of the layout; - `include` - Specifies a list of routing rules that use this layout, which can be a regular expression or a string; - - `exlude` - Specifies a list of routing rules that do not use this layout, which can be a regular expression or a string. + - `exclude` - Specifies a list of routing rules that do not use this layout, which can be a regular expression or a string. - > Note: `exlude` takes precedence over `include`, and the layout previous it has a higher priority than the behind layout. The development process may need to be combined with the layout in the `src/layouts` directory. For details, see [Using Layout](./layout.md). + > Note: `exclude` takes precedence over `include`, and the layout previous it has a higher priority than the behind layout. The development process may need to be combined with the layout in the `src/layouts` directory. For details, see [Using Layout](./layout.md). ## i18n @@ -91,9 +91,9 @@ You can do some custom configuration in `/src/utils/config.js`: - `key` - The `key` of the language is applied to the page url to distinguish the language, and also corresponds to the language package folder name in the `src/locales` directory; - - `title` - The name of the language, at the bottom of the login page, at the top of the `Primay` layout, the language switch is displayed; + - `title` - The name of the language, at the bottom of the login page, at the top of the `Primary` layout, the language switch is displayed; - - `flag` - The path of the flag icon of the language, the language switching display at the top of the `Primay` layout. + - `flag` - The path of the flag icon of the language, the language switching display at the top of the `Primary` layout. ### i18n.defaultLanguage From 358134f417d5e9741a97970b3852c2ae00c72d5f Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Sun, 9 Dec 2018 23:07:16 +0800 Subject: [PATCH 2/6] fallback umi to 2.2.8 to fix #923 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 38e04df..5b2938d 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "stylelint": "^9.8.0", "stylelint-config-prettier": "^4.0.0", "stylelint-config-standard": "^18.2.0", - "umi": "^2.3.0-beta.1", + "umi": "^2.2.8", "umi-plugin-react": "^1.2.3" }, "optionalDependencies": { From 94c8e2168f5e3c8e023986dd5bec9f1109224a0b Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Wed, 12 Dec 2018 06:17:30 +0800 Subject: [PATCH 3/6] fix #926 createUser api in services --- src/services/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/api.js b/src/services/api.js index f745bd2..e34b942 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -8,7 +8,7 @@ export default { queryUser: '/user/:id', queryUserList: '/users', updateUser: 'Patch /user/:id', - createUser: 'POST /user/:id', + createUser: 'POST /user', removeUser: 'DELETE /user/:id', removeUserList: 'POST /users/delete', From 0949a298c99d787e6369cac348cb5fcc29ad044e Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Wed, 12 Dec 2018 06:53:26 +0800 Subject: [PATCH 4/6] fix #924 404 Not Found after router change --- src/utils/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index 097502a..33bd195 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -246,9 +246,8 @@ export function getLocale() { export function setLocale(language) { if (getLocale() !== language) { umiRouter.push({ - pathname: `/${language}${deLangPrefix(window.location.pathname)}${ - window.location.search - }`, + pathname: `/${language}${deLangPrefix(window.location.pathname)}`, + search: window.location.search, }) } } From d03787a871899b53f04926a7cbbed5f251ee5178 Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Wed, 12 Dec 2018 13:48:34 +0800 Subject: [PATCH 5/6] Publish antd-admin@5.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5b2938d..8ae2707 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd-admin", - "version": "5.0.0", + "version": "5.0.1", "private": true, "description": "An admin dashboard application demo built upon Ant Design and UmiJS", "dependencies": { From 285f06d1e7fc5ca1c1c4c0412bfc70ca0de00200 Mon Sep 17 00:00:00 2001 From: luckcoding Date: Thu, 13 Dec 2018 16:57:49 +0800 Subject: [PATCH 6/6] fix bread route has no matching lang --- src/components/Layout/Bread.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Layout/Bread.js b/src/components/Layout/Bread.js index 67cc7d6..db202f5 100644 --- a/src/components/Layout/Bread.js +++ b/src/components/Layout/Bread.js @@ -4,7 +4,7 @@ import { Breadcrumb, Icon } from 'antd' import Link from 'umi/navlink' import withRouter from 'umi/withRouter' import { withI18n } from '@lingui/react' -import { pathMatchRegexp, queryAncestors } from 'utils' +import { pathMatchRegexp, queryAncestors, addLangPrefix } from 'utils' import styles from './Bread.less' @withI18n() @@ -24,7 +24,7 @@ class Bread extends PureComponent { return ( {paths.length - 1 !== key ? ( - {content} + {content} ) : ( content )}