Pārlūkot izejas kodu

自动重定向的逻辑优化

任一存 1 gadu atpakaļ
vecāks
revīzija
1f4a322826
2 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 1 1
      game/src/router/index.js
  2. 2 0
      game/src/views/HomeView.vue

+ 1 - 1
game/src/router/index.js

@@ -89,7 +89,7 @@ const router = createRouter({
 
 router.beforeEach((to, from) => {
   // 生产环境下强制每次都从首页进入
-  if (process.env.NODE_ENV === 'production' && !from.name && to.name !== 'HomeView') {
+  if (process.env.NODE_ENV === 'production' && !from.name && to.name !== 'HomeView' && !to.query['no-redirect']) {
     return '/'
   }
 })

+ 2 - 0
game/src/views/HomeView.vue

@@ -411,6 +411,8 @@ if (route.query.gameIdx) {
     onClickGameEntry(gameIdx)
   }
 }
+
+console.log(route.query)
 </script>
 
 <style lang="less" scoped>