feat:代码上传
This commit is contained in:
@ -75,15 +75,18 @@
|
||||
username: 'admin', // 设置用户名
|
||||
password: 'zzkj@688737' // 设置密码
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getSn()
|
||||
},
|
||||
computed: {
|
||||
lang() {
|
||||
return Langlist.find(v => v.value == this.$store.state.vuex_language).prop || 'en'
|
||||
},
|
||||
currentStation() {
|
||||
return this.$store.state.vuex_currentStation;
|
||||
return this.vuex_currentStation;
|
||||
},
|
||||
},
|
||||
|
||||
@ -92,8 +95,16 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
getSn(){
|
||||
this.$u.api.station.getStationPostionSn({
|
||||
stationId: this.currentStation.id
|
||||
}).then(res => {
|
||||
this.sn = res.data[0]?.sn
|
||||
})
|
||||
},
|
||||
initmqttClient() {
|
||||
|
||||
console.log(this.lang)
|
||||
console.log(this.currentStation)
|
||||
// 初始化客户端连接地址
|
||||
// #ifdef H5
|
||||
let mqttClient = mqtt.connect('ws://1.95.170.86:8083/mqtt', {
|
||||
@ -110,10 +121,10 @@
|
||||
mqttClient.on('connect', function(res) {
|
||||
console.log('连接成功')
|
||||
// 订阅主题
|
||||
mqttClient.subscribe(`1/ems/zzkj0002/control/response`, function(err) {
|
||||
mqttClient.subscribe(`1/ems/${this.sn}/control/response`, (err) => {
|
||||
if (!err) {
|
||||
// 订阅成功
|
||||
mqttClient.publish('1/app/zzkj0002/control/request', JSON.stringify({
|
||||
mqttClient.publish(`1/app/${this.sn}/control/request`, JSON.stringify({
|
||||
fun: 'GET',
|
||||
type: 'WJ_Get_NewControlSystem',
|
||||
content: 0
|
||||
@ -250,7 +261,7 @@
|
||||
return pre
|
||||
}, {})
|
||||
|
||||
this.mqttClient.publish(`1/app/zzkj0002/control/request`, JSON.stringify({
|
||||
this.mqttClient.publish(`1/app/${this.sn}/control/request`, JSON.stringify({
|
||||
fun: 'SET',
|
||||
type: 'WJ_Set_NewControlSystem',
|
||||
content: {
|
||||
|
||||
Reference in New Issue
Block a user