123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- const innetExportUrl = import.meta.env.VITE_WS_INNET_EXPORT_API
- const outnetExportUrl = import.meta.env.VITE_WS_OUTNET_EXPORT_API
- const innetUrl = import.meta.env.VITE_WS_INNET_API
- const outnetUrl = import.meta.env.VITE_WS_OUTNET_API
- const hostIp = import.meta.env.VITE_HOST_IP;
- export function getWsUrl() {
- var itemUrl = document.location.origin;
- console.log(itemUrl)
- if (itemUrl.includes(hostIp)) {
- return innetUrl;
- } else {
- return outnetUrl;
- }
- }
- export function getWsExportUrl() {
- var itemUrl = document.location.origin;
- if (itemUrl.includes(hostIp)) {
- return innetExportUrl;
- } else {
- return outnetExportUrl;
- }
- }
- export function patternNginxWsUrl() {
- var itemUrl = document.location.origin;
- // console.log(itemUrl)
- // if (itemUrl.includes(hostIp)) {
- // return "ws://" + hostIp + "/ws/"
- // } else {
- // return "ws://120.46.159.163/ws/"
- // }
- return itemUrl.replace('http', 'ws') + '/ws/'
- }
- export function patternNginxExportWsUrl() {
- // var itemUrl = document.location.origin;
- // console.log(itemUrl)
- // if (itemUrl.includes(hostIp)) {
- // return "ws://" + hostIp + "/ws/"
- // } else {
- // return "ws://120.46.159.163/ws/"
- // }
- return itemUrl.replace('http', 'ws') + '/ws-production/'
- }
|