import router from '@/router' import { done, start } from '@/utils/nprogress' const WHITE_LIST = ['/', '/falow'] export const setupAuthRoutes = () => { router.beforeEach(async (to, _from, next) => { start() if (WHITE_LIST.includes(to.path)) return next() // 重定向登录页面 next(`/`) }) router.afterEach(() => { done() // 结束Progress }) }