update data/components/eabb131d-8fd1-43a8-88d9-a198abfd3d42/component.js.
mqtt上报补充回复消息 Signed-off-by: xiwa <xw2sy@163.com>V0.5.x
parent
5acff31822
commit
f024df55e9
|
@ -173,6 +173,20 @@ this.onReceive=function(head,type,payload){
|
|||
}
|
||||
|
||||
//数据上报
|
||||
var reply=
|
||||
{
|
||||
productKey:pk,
|
||||
deviceName:dn,
|
||||
mid:payload.id,
|
||||
content:{
|
||||
topic:topic.replace("/s/","/c/")+"_reply",
|
||||
payload:JSON.stringify({
|
||||
id:payload.id,
|
||||
method: payload.method+"_reply",
|
||||
code:0,
|
||||
})
|
||||
}
|
||||
};
|
||||
return {
|
||||
type:"report",
|
||||
data:{
|
||||
|
@ -183,6 +197,10 @@ this.onReceive=function(head,type,payload){
|
|||
topic:topic,
|
||||
payload:payload
|
||||
}
|
||||
},
|
||||
action:{
|
||||
type:"ack",
|
||||
content:JSON.stringify(reply)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue