Skip to content

Commit

Permalink
fix(web): 优化ws连接
Browse files Browse the repository at this point in the history
  • Loading branch information
aide-cloud committed Apr 23, 2024
1 parent 41f2316 commit ed477d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web/src/apis/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const wsHostMap: { [key: string]: string } = {
}

export const getWsURL = () => {
// http替换为ws
let host = window.location.origin
host = host.replace('http', 'ws')
return (wsHostMap[host] || host || process.env.REACT_APP_WS_API) + 'ws'
}

Expand Down

0 comments on commit ed477d6

Please sign in to comment.