1
0
forked from dyf/dyf-vue-ui

修复设备日志

This commit is contained in:
fengerli
2025-09-19 17:24:12 +08:00
parent bf1eb3ecbb
commit 517998a0db
5 changed files with 13 additions and 40 deletions

View File

@ -17,8 +17,10 @@ export interface SubscribeOptions {
// 根据当前页面协议自动选择MQTT配置
const getMqttConfig = () => {
// 检测当前页面协议http: 或 https:
const isHttps = window.location.protocol === 'https:';
console.log(isHttps,'检测环境');
//const isHttps = window.location.protocol === 'https:';
const isHttps = import.meta.env.VITE_APP_ENV === 'production' || window.location.protocol === 'https:';
console.log(isHttps,'检测环境');
return {
// 自动切换协议https页面用wsshttp页面用ws