Skip to content

Commit

Permalink
fix login jump to /enundefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Baorong Li committed Jun 29, 2019
1 parent fc9565c commit 3cb7f86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 3cb7f86

Please sign in to comment.