@@ -18,35 +18,35 @@ export const router = new VueRouter(RouterConfig);
1818router . beforeEach ( ( to , from , next ) => {
1919 iView . LoadingBar . start ( ) ;
2020 Util . title ( to . meta . title ) ;
21- if ( Cookies . get ( 'locking' ) === '1' && to . name !== 'locking' ) { // 判断当前是否是锁定状态
21+ if ( Cookies . get ( 'locking' ) === '1' && to . name !== 'locking' ) {
2222 next ( {
2323 replace : true ,
2424 name : 'locking'
2525 } ) ;
2626 } else if ( Cookies . get ( 'locking' ) === '0' && to . name === 'locking' ) {
2727 next ( false ) ;
2828 } else {
29- if ( ! Util . abp . session . userId && to . name !== 'login' ) { // 判断是否已经登录且前往的页面不是登录页
29+ if ( ! Util . abp . session . userId && to . name !== 'login' ) {
3030 next ( {
3131 name : 'login'
3232 } ) ;
33- } else if ( ! ! Util . abp . session . userId && to . name === 'login' ) { // 判断是否已经登录且前往的是登录页
33+ } else if ( ! ! Util . abp . session . userId && to . name === 'login' ) {
3434 Util . title ( to . meta . title ) ;
3535 next ( {
3636 name : 'home'
3737 } ) ;
3838 } else {
3939 const curRouterObj = Util . getRouterObjByName ( [ otherRouters , ...appRouters ] , to . name ) ;
40- if ( curRouterObj && curRouterObj . permission ) { // 需要判断权限的路由
40+ if ( curRouterObj && curRouterObj . permission ) {
4141 if ( window . abp . auth . hasPermission ( curRouterObj . permission ) ) {
42- Util . toDefaultPage ( [ otherRouters , ...appRouters ] , to . name , router , next ) ; // 如果在地址栏输入的是一级菜单则默认打开其第一个二级菜单的页面
42+ Util . toDefaultPage ( [ otherRouters , ...appRouters ] , to . name , router , next ) ;
4343 } else {
4444 next ( {
4545 replace : true ,
4646 name : 'error-403'
4747 } ) ;
4848 }
49- } else { // 没有配置权限的路由, 直接通过
49+ } else {
5050 Util . toDefaultPage ( [ ...routers ] , to . name , router , next ) ;
5151 }
5252 }
0 commit comments