exports.install = function (Vue, options) {
    Vue.prototype.$mqttconnects = function (clientID,username,password,willtopic,willpayload) { //全局函数
        let options = {
            connectTimeout: 4000, // 超时时间
            // 认证信息
            clientId:clientID,
            username:username,
            password:password,
            timeout: 3,
            useSSL: true,
            cleanSession: true,
            keepAliveInterval: 60,
            reconnect: true,
            mqttVersion: 4,
            mqttVersionExplicit: true,
            will: {
                topic: willtopic,
                payload: willpayload,
                qos: 0,
                retain:false
            }
        }
        let url = 'wss://coreiothubcn.azure-devices.cn/$iothub/websocket?iothub-no-client-cert=true'
        let client = this.$mqtt.connect(url, options)
        console.log(client)
        return client;
    }
};