diff --git a/src/config.js b/src/config.js index 8705dfd063c4bdbb1c431b98264b67893fd04885..ea626cb3cc6c59b7e95bd6eeaeec8fc6cf8d914d 100644 --- a/src/config.js +++ b/src/config.js @@ -12,4 +12,5 @@ export default { successCode: 'sys.success', // 后台正常返回错误编码 isThrowError: true, // 默认为true copyright: `${new Date().getFullYear()} KIM3.0技术中台部出品`, + homePage: '/dashboard/analysis', }; diff --git a/src/pages/Authorized.tsx b/src/pages/Authorized.tsx index 1bfd82670bf4c1a9fcdfb249b3b9654b479c057f..91bc1045375214b09f74559fc15fafbd86317340 100644 --- a/src/pages/Authorized.tsx +++ b/src/pages/Authorized.tsx @@ -25,6 +25,7 @@ const getRouteAuthority = (path: string, routeData: Route[]) => { } } }); + console.log('authorities:', authorities); return authorities; }; diff --git a/src/pages/user/login/models/index.js b/src/pages/user/login/models/index.js index 5fa8f4f21ab66204a1f1ba8e4583934d67ea5022..500aff9088cd52e5e02f0a1033a6d6d95b77135c 100644 --- a/src/pages/user/login/models/index.js +++ b/src/pages/user/login/models/index.js @@ -1,7 +1,8 @@ +import { routerRedux } from 'dva/router'; import { login } from '../services'; import store from '@/utils/store'; -import { routerRedux } from 'dva/router'; import { getPageQuery } from '@/utils'; +import config from '@/config'; const initData = {}; export default { @@ -33,6 +34,8 @@ export default { window.location.href = redirect; return; } + } else { + redirect = config.homePage; } yield put(routerRedux.replace(redirect || '/')); }