Commit b1b3ee2ac99f62fce8e92d291b7bab4b211d81f1

Authored by fengwotao
1 parent 6ec84b46

fix: 修复动态切换请求方式完整地址显示问题

@@ -64,11 +64,13 @@ export const useUtils = () => { @@ -64,11 +64,13 @@ export const useUtils = () => {
64 const pathUrl = window.location.host; 64 const pathUrl = window.location.host;
65 const protocol = window.location.protocol; 65 const protocol = window.location.protocol;
66 let url = ''; 66 let url = '';
67 - if (method === '2') { 67 + if (method === RequestMethodTypeEnum.WEBSOCKET) {
68 if (type === 'server_url') { 68 if (type === 'server_url') {
69 - url = `${protocol === 'http' ? 'ws:' : protocol === 'https' ? 'wss:' : 'ws:'}//${pathUrl}`; 69 + url = `${
  70 + protocol === 'http:' ? 'ws:' : protocol === 'https:' ? 'wss:' : 'ws:'
  71 + }//${pathUrl}`;
70 } 72 }
71 - } else if (method === '0') { 73 + } else if (method === RequestMethodTypeEnum.COMMOM) {
72 if (type === 'server_url') { 74 if (type === 'server_url') {
73 url = `${protocol}//${pathUrl}`; 75 url = `${protocol}//${pathUrl}`;
74 } 76 }