Kaynağa Gözat

跳转优化

林旭祥 8 ay önce
ebeveyn
işleme
6798ed5bb3
2 değiştirilmiş dosya ile 10 ekleme ve 4 silme
  1. 7 1
      src/router/permission.ts
  2. 3 3
      src/views/login/mobile.vue

+ 7 - 1
src/router/permission.ts

@@ -13,6 +13,8 @@ router.beforeEach(async (to, from, next) => {
     //已登录
     if (to.path === '/login') {
       next({ path: '/' });
+    } else if (to.path === '/login/qrcode') {
+      next({ path: '/gesture' });
     } else {
       next();
     }
@@ -23,7 +25,11 @@ router.beforeEach(async (to, from, next) => {
       next();
     } else {
       // 否则全部重定向到登录页
-      next(`/login`);
+      if (to.path === '/gesture') {
+        next(`/login/qrcode`);
+      } else {
+        next(`/login`);
+      }
     }
   }
 });

+ 3 - 3
src/views/login/mobile.vue

@@ -43,9 +43,9 @@ const data = reactive<any>({
   show: false,
   handcontroller: '',
   loginForm: {
-    deviceid: '38715692',
-    username: 'manage1',
-    password: 'trops@2022'
+    deviceid: '',
+    username: '',
+    password: ''
   },
   loading: false,
 });