Skip to content

Commit a470b74

Browse files
authored
Merge pull request #71 from Game-as-a-Service/feat/gaas-connect
Feat/gaas connect
2 parents de852d1 + 4d812d2 commit a470b74

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/components/MainLayout.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ const showHintStart = ref(false)
5050
console.log(route, 'route')
5151
console.log('gameId: ', route.params.gameId)
5252
console.log('user token: ', route.query.token)
53-
apiWithToken.get('/me').then((res) => {
54-
console.log(res.data, 'me')
55-
playerId.value = res.data.player_id
56-
})
57-
5853
const gameOver = computed(() => gameStore.gameOver)
5954
const handleConnect = () => {
6055
socket.value = io(import.meta.env.VITE_SOCKET_IO_URL, {
@@ -179,8 +174,11 @@ onMounted(() => {
179174
// playerId.value = route.query.playerId
180175
// handleConnect()
181176
}
182-
handleConnect()
183-
177+
apiWithToken.get('/me').then((res) => {
178+
console.log(res.data, 'me')
179+
playerId.value = res.data.player_id
180+
handleConnect()
181+
})
184182
console.log('mounted')
185183
console.log(import.meta.env.VITE_SOCKET_IO_URL)
186184
})

0 commit comments

Comments
 (0)