This commit is contained in:
赵毅 2025-09-24 18:09:16 +08:00
parent 9b6a3c9bce
commit dbae8b4a5a

View File

@ -1,5 +1,13 @@
import mqtt from 'mqtt/dist/mqtt'
import Vue from 'vue'
// 引入Buffer适配小程序环境
import { Buffer } from 'buffer';
// 挂载到全局,确保所有文件可访问
if (typeof window !== 'undefined') {
window.Buffer = Buffer;
} else if (typeof global !== 'undefined') {
global.Buffer = Buffer;
}
let mqttTool = {
client: null