Pārlūkot izejas kodu

添加更多的条件

林旭祥 1 mēnesi atpakaļ
vecāks
revīzija
54f2e68767
1 mainītis faili ar 13 papildinājumiem un 12 dzēšanām
  1. 13 12
      src/layout/index.vue

+ 13 - 12
src/layout/index.vue

@@ -13,36 +13,36 @@ const { proxy } = getCurrentInstance() as any;
 const router = useRouter();
 
 const data = reactive<any>({
-  timer: null,
-
+  timer: null
 });
 const { timer } = toRefs(data);
 
-
 const handClick = () => {
-  getClearTimer()
+  getClearTimer();
   getCountDown();
 };
 
 const getCountDown = () => {
   timer.value = setTimeout(() => {
-    if (!['/ranking', '/login/mobile', '/sunshineRun'].includes(router.currentRoute.value.fullPath)) {
+    if (
+      !['/ranking', '/login', '/login/qrcode', '/login/mobile', '/login/sunshineRun', '/sunshineRun'].includes(router.currentRoute.value.fullPath)
+    ) {
       router.push({ path: '/ranking' });
     }
-  }, 1000 * 60 * 10)
+  }, 1000 * 60 * 10);
 };
 
 const getClearTimer = () => {
-  clearTimeout(timer.value)
+  clearTimeout(timer.value);
 };
 
 onMounted(() => {
-  getCountDown()
-})
+  getCountDown();
+});
 
 onBeforeUnmount(() => {
-  getClearTimer()
-})
+  getClearTimer();
+});
 </script>
 <style lang="scss" scoped>
 .app-main {
@@ -64,4 +64,5 @@ onBeforeUnmount(() => {
 // ::-webkit-scrollbar-thumb {
 //   background-color: #c0c0c0;
 //   border-radius: 3px;
-// }</style>
+// }
+</style>