Skip to content

Commit

Permalink
fix(other): 新增设备默认状态
Browse files Browse the repository at this point in the history
修复dgiot-amis 组件在切换账号后,认证仍为上一次的信息
  • Loading branch information
h7ml committed Jun 21, 2022
1 parent 7ea7404 commit 8b11081
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Vue.use(VuePlugin)
window.dgiotlogger =
process.env.NODE_ENV !== 'development' && clearConsole
? new Lajax({
url: '/',
url: 'https://reqres.in/api/users',
autoLogError: true, //是否自动记录未捕获错误true
autoLogRejection: false, //是否自动记录Promise错误true
autoLogAjax: false, //是否自动记录 ajax 请求true
Expand Down
12 changes: 3 additions & 9 deletions src/views/DeviceCloud/manage/devicelist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@
},
name: '',
isEnable: true,
status: 'OFFLINE',
status: 'ONLINE',
devaddr: '',
basedata: {},
route: {},
Expand Down Expand Up @@ -1082,14 +1082,8 @@
await this.subAllDevice()
},
async subAllDevice() {
const topics = []
this.list.forEach((item) => {
topics.push(
`/$dg/thing/device/${item.product.objectId}/${item.devaddr}/properties/publish`
)
})
await this.$subscribe(topics)
this.$dgiotBus.$on('/$dg/thing', (Msg) => {
await this.$subscribe('$dg/user/devicestate/#')
this.$dgiotBus.$on('/$dg/user', (Msg) => {
console.log('收到消息', Msg)
const parseString = JSON.parse(Msg.payloadString)
console.log('收到消息', parseString)
Expand Down
11 changes: 2 additions & 9 deletions src/views/DeviceCloud/manage/home_index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1215,15 +1215,8 @@
await this.subAllDevice()
},
async subAllDevice() {
const topics = []
this.list.forEach((item) => {
topics.push(
`/$dg/thing/device/${item.product.objectId}/${item.devaddr}/properties/publish`
)
})
await this.$subscribe(topics)
// this.$dgiotBus.$off(this.$mqttInfo.topicKey)
this.$dgiotBus.$on('/$dg/thing', (Msg) => {
await this.$subscribe('$dg/user/devicestate/#')
this.$dgiotBus.$on('/$dg/user', (Msg) => {
console.log('收到消息', Msg)
const parseString = JSON.parse(Msg.payloadString)
console.log('收到消息', parseString)
Expand Down

0 comments on commit 8b11081

Please sign in to comment.