diff --git a/src/models/app.js b/src/models/app.js index f1891ac..49cb085 100644 --- a/src/models/app.js +++ b/src/models/app.js @@ -72,11 +72,8 @@ export default { yield put(routerRedux.push('/dashboard')) } } else { - if (location.pathname !== '/login') { + if (config.openPages && config.openPages.indexOf(location.pathname) < 0) { let from = location.pathname - if (location.pathname === '/dashboard') { - from = '/dashboard' - } window.location = `${location.origin}/login?from=${from}` } } diff --git a/src/models/user.js b/src/models/user.js index 182023e..1909179 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -98,7 +98,7 @@ export default modelExtend(pageModel, { reducers: { showModal (state, { payload }) { - return { ...state, ...{ payload }, modalVisible: true } + return { ...state, ...payload, modalVisible: true } }, hideModal (state) {