import appConfig from '@/config/index' ; let isLoginRequired = ( routeName ) : boolean => { let notLoginRoute = appConfig . notLoginRoute as string [ ] | null ; const notLoginMark = { } ; if ( Array . isArray ( notLoginRoute ) ) { for ( let i = 0 ; i < notLoginRoute . length ; i += 1 ) { notLoginMark [ notLoginRoute [ i ] . toString ( ) ] = true ; } } notLoginRoute = null ; isLoginRequired = name => { if ( ! name ) { return true ; } if ( typeof name === 'string' && name . indexOf ( '/' ) === 0 ) { name = name . substring ( 1 ) ; } const target = typeof name === 'symbol' ? ( name as any ) . description : name ; return ! notLoginMark [ target ] ; } ; return isLoginRequired ( routeName ) ; } ; export { isLoginRequired } ;