Просмотр исходного кода

bug fix: 如果是点击游戏入口触发了登录,但登录、注册未成功即回到首页,则不应自动进入游戏页。

任一存 1 год назад
Родитель
Сommit
da24980634
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      game/src/views/HomeView.vue

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

@@ -387,11 +387,14 @@ function onLoginChoiceClose() {
   isShowLoginChoice.value = false
 }
 
-// 登录、注册完毕后回到首页,可能需要自动进入游戏页
+// 如果是点击游戏入口触发了登录、注册,且登录、注册完毕后回到首页,需要自动进入游戏页。
+// 如果是点击游戏入口触发了登录,但登录、注册未成功即回到首页,则不应自动进入游戏页。
 if (store.state.gameToPlayIdx !== null) {
   const gameIdx = store.state.gameToPlayIdx
   store.state.gameToPlayIdx = null
-  entryFunctionList[gameIdx]()
+  if (store.state.loginStatus) {
+    entryFunctionList[gameIdx]()
+  }
 }
 
 // 如果通过url要求自动进入游戏页