fix login jump to /enundefined

This commit is contained in:
Baorong Li
2019-06-29 10:49:11 +08:00
parent fc9565c157
commit 3cb7f86086
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -49,12 +49,12 @@
"cross-env": "^5.2.0",
"eslint": "^5.15.0",
"eslint-config-react-app": "^4.0.0",
"eslint-plugin-flowtype": "^3.4.0",
"eslint-plugin-import": "^2.17.0",
"eslint-plugin-flowtype": "^3.11.0",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.13.0",
"eslint-plugin-react": "^7.14.0",
"eslint-plugin-react-hooks": "^1.6.0",
"husky": "^2.3.0",
"husky": "^2.7.0",
"less-vars-to-js": "^1.3.0",
"lint-staged": "^8.1.0",
"mockjs": "^1.0.1-beta3",
@@ -63,8 +63,8 @@
"stylelint": "^10.0.0",
"stylelint-config-prettier": "^5.2.0",
"stylelint-config-standard": "^18.3.0",
"umi": "^2.8.1",
"umi-plugin-react": "^1.9.1"
"umi": "^2.8.7",
"umi-plugin-react": "^1.9.6"
},
"lint-staged": {
"src/**/*.js": [
+1 -1
View File
@@ -16,7 +16,7 @@ export default {
const { from } = locationQuery
yield put({ type: 'app/query' })
if (!pathMatchRegexp('/login', from)) {
if (from === '/') router.push('/dashboard')
if (['', '/'].includes(from)) router.push('/dashboard')
else router.push(from)
} else {
router.push('/dashboard')