upgrade umi@3 partly

This commit is contained in:
Baorong Li
2020-03-19 12:50:12 +08:00
parent 7938d71f2f
commit 9e778487d9
2 changed files with 1 additions and 2 deletions
-1
View File
@@ -52,7 +52,6 @@ export default {
dispatch({ type: 'query' })
},
setupHistory({ dispatch, history }) {
console.log(history)
history.listen(location => {
dispatch({
type: 'updateState',
+1 -1
View File
@@ -13,7 +13,7 @@ export default {
subscriptions: {
setup({ dispatch, history }) {
history.listen(({ pathname }) => {
const match = pathToRegexp('/user/:id', pathname)
const match = pathToRegexp('/user/:id').exec(pathname)
if (match) {
dispatch({ type: 'query', payload: { id: match[1] } })
}