Commit dd6e6b3a542be0b0e1526925f765f46043e2f833
Merge branch 'ft' into 'main_dev'
fix: 修复动态切换请求方式完整地址显示问题(判断协议少加冒号) See merge request yunteng/thingskit-front!586
Showing
1 changed file
with
5 additions
and
3 deletions
| @@ -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 | } |