提交 b9648eab 作者: 翁进城

增加取消订阅

上级 0a76edf0
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
* @param {*} topic * @param {*} topic
* @returns * @returns
*/ */
unsubscribe({ state }, { topic }) { unsubscribe({ state }, { topic, deviceHardId }) {
if (!topic) { if (!topic) {
return topic; return topic;
} }
...@@ -132,7 +132,7 @@ export default { ...@@ -132,7 +132,7 @@ export default {
* @param {*} type * @param {*} type
*/ */
publish({ state }, { topic, data, callback, options = { qos: 0 } }) { publish({ state }, { topic, data, callback, options = { qos: 0 } }) {
console.log('publish', topic, data) console.log("publish", topic, data);
state.client.publish( state.client.publish(
topic, topic,
new TextEncoder().encode(JSON.stringify(data)), new TextEncoder().encode(JSON.stringify(data)),
...@@ -159,8 +159,8 @@ export default { ...@@ -159,8 +159,8 @@ export default {
data: { data: {
type: orders[order], type: orders[order],
data, data,
callback,
}, },
callback,
}); });
}, },
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论