import router from '@/router';
import { getUserCookie } from '@/utils/api/userApi';
router.beforeEach((to: any, from: any, next: any) => {
  if (to.name == 'login') {
    next();
    return;
  }
  // 用户token
  let token = getUserCookie();
  if (!token) {
    next('/login');
    return;
  }
  next();
});
