Skip to content

Commit

Permalink
Merge pull request #81 from our-mini-games/feat-Chinese-chess
Browse files Browse the repository at this point in the history
fix: 更新socket连接配置
  • Loading branch information
humandetail committed Dec 14, 2023
2 parents 9f9816a + bd660f8 commit b68cd36
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/Chinese-chess/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_APP_PATHNAME = /
VITE_SOCKET = ws://localhost:10086/
VITE_SOCKET = http://localhost:10086/
2 changes: 1 addition & 1 deletion packages/Chinese-chess/.env.production
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_APP_PATHNAME = /mini-games/games/chinese-chess/
VITE_SOCKET = wss://chess-service.humandetail.com/
VITE_SOCKET = https://chess-service.humandetail.com/
4 changes: 3 additions & 1 deletion packages/Chinese-chess/src/composables/useSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export const useSocket = ($: any) => {
const isInit = computed(() => context.value?.status === GameStatus.Init)

onMounted(() => {
socket.value = io(import.meta.env.VITE_SOCKET)
socket.value = io(import.meta.env.VITE_SOCKET, {
transports: ['websocket']
})

socket.value.on(events.client.connect, () => {
if (!currentUser.value) {
Expand Down

0 comments on commit b68cd36

Please sign in to comment.