diff --git a/src/components/global.vue b/src/components/global.vue index 5d30c10..ff86aff 100644 --- a/src/components/global.vue +++ b/src/components/global.vue @@ -113,7 +113,10 @@ DYZshow: false, // 是否显示打印中 downloadPath: 'D:\\TZDYSHARE\\TEMPFILES\\', - state: '', + state: { + name: '', + sta: false + }, src: '', zfShow: false, @@ -125,7 +128,12 @@ numZt: 120, ztyc: false, - citeL: '' + citeL: { + loadingSta: { + sta: false, + name: 'Loading' + } + } } }, created() { @@ -176,9 +184,14 @@ // sta: false // } getDeviceCode().then(res => { - this.cite.code = res.data - this.code = res.data - this.load() + if(this.code=='') { + this.cite.code = res.data + this.code = res.data + this.load() + }else{ + this.cite.code = res.data + this.code = res.data + } this.cite.loadingSta = { sta: false } @@ -202,11 +215,12 @@ } }, initMqtt() { + let code = 'tzdy-web::'+this.code // 连接配置选项 let options = { connectTimeout: 4000, // 超时时间 // 认证信息 - clientId: `tzdy-web::${this.cite.code}`, //不填默认随机生成一个ID + clientId: code, //不填默认随机生成一个ID username: 'admin', //用户名 password: 'public' //密码 }