mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-31 14:33:44 +00:00
Update app.js
如果在config.js中添加了openPages,比如openPages: ['/login', '/home'],但是进入/home页面仍然要先登录,所以在app model中如果query不成功需要判断当前页面是否被设置成openPages,再决定是否跳转到/login
This commit is contained in:
+1
-4
@@ -43,11 +43,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}`
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user