修复设备列表,编辑时,不修改图片不需要传file字段

This commit is contained in:
fengerli
2025-09-19 10:56:49 +08:00
parent f853349d1e
commit bf1eb3ecbb
2 changed files with 15 additions and 5 deletions

View File

@ -18,6 +18,8 @@ export interface SubscribeOptions {
const getMqttConfig = () => {
// 检测当前页面协议http: 或 https:
const isHttps = window.location.protocol === 'https:';
console.log(isHttps,'检测环境');
return {
// 自动切换协议https页面用wsshttp页面用ws
protocol: isHttps ? 'wss' : 'ws',
@ -57,8 +59,15 @@ export function useMqtt() {
error.value = null;
try {
// 打印当前使用的配置(方便调试)
console.log('当前MQTT连接配置:', {
protocol: MQTT_CONFIG.protocol,
host: MQTT_CONFIG.host,
port: MQTT_CONFIG.port,
clientId: MQTT_CONFIG.clientId
});
client = new Paho.Client(
MQTT_CONFIG.host,
MQTT_CONFIG.host,
MQTT_CONFIG.port,
MQTT_CONFIG.clientId
);