File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,6 @@ const showHintStart = ref(false)
5050console .log (route, ' route' )
5151console .log (' gameId: ' , route .params .gameId )
5252console .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-
5853const gameOver = computed (() => gameStore .gameOver )
5954const 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})
You can’t perform that action at this time.
0 commit comments