Refactor API requests and update imports
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import mqtt, { MqttClient, IClientOptions } from 'mqtt'
|
||||
import mqtt from 'mqtt'
|
||||
|
||||
// MQTT 配置
|
||||
const defaultOptions: IClientOptions = {
|
||||
const defaultOptions: any = {
|
||||
clean: true,
|
||||
connectTimeout: 4000,
|
||||
clientId: 'vue3-client-' + Math.random().toString(16).substr(2, 8),
|
||||
@ -16,9 +16,9 @@ const defaultOptions: IClientOptions = {
|
||||
const brokerUrl = 'wss://www.tuxixi.net/mqtt'
|
||||
|
||||
export default class MQTTClient {
|
||||
private client: MqttClient | null = null
|
||||
private client: any | null = null
|
||||
private url: string
|
||||
private options: IClientOptions
|
||||
private options: any
|
||||
|
||||
constructor(url: string, options = {} as any) {
|
||||
this.client = null
|
||||
|
||||
Reference in New Issue
Block a user