chenyc
2025-09-23 afa0ffca1673eb61c27496b9988fa8559678bd94
src/router/index.ts
@@ -92,13 +92,18 @@
// 路由加载前
router.beforeEach(async (to, from, next) => {
   console.log('to', to);
   NProgress.configure({ showSpinner: false });
   if (to.meta.title) NProgress.start();
   const token = Session.get('token');
   if (to.path === '/login' && !token) {
      next();
      NProgress.done();
   } else {
   }else if ((to.path === '/register'||to.path==='/registerSuu') && !token) {
      next();
      NProgress.done();
   }
    else {
      if (!token) {
         next(`/login?redirect=${to.path}&params=${JSON.stringify(to.query ? to.query : to.params)}`);
         Session.clear();