11
This commit is contained in:
parent
9b6a3c9bce
commit
dbae8b4a5a
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user