兰宝车间质量管理系统-前端
疯狂的狮子Li
2023-11-13 35bebf403ca0729174d49e86feb8fb6e468c69de
update 适配 websocket在https下的连接方式
已修改1个文件
3 ■■■■ 文件已修改
src/views/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/index.vue
@@ -99,7 +99,8 @@
import { initWebSocket } from '@/utils/websocket';
onMounted(() => {
  initWebSocket("ws://" + window.location.host + import.meta.env.VITE_APP_BASE_API + "/resource/websocket");
  let protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://'
  initWebSocket(protocol + window.location.host + import.meta.env.VITE_APP_BASE_API + "/resource/websocket");
});
const goTarget = (url:string) => {