Refactor API requests and update imports

This commit is contained in:
wangqiao
2025-08-18 22:15:55 +08:00
parent ba5f777ed0
commit aac4dec3fd
17 changed files with 113 additions and 193 deletions

View File

@ -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