Home > front end >  Small program sends a message appear data format error
Small program sends a message appear data format error

Time:11-27

Small program problem which plate should be sent to??????


With reference to write, but when the cloud function called
Always appear
Errcode: 47001
Errmsg: "data format error rid: 5 fbf0bd2-06 f26aca - 402187 ce"
How to change?




SubmitInfo: function (e) {

The console. The log (e.d etail. FormId);
Wx. Cloud. CallFunction ({
Name: 'msgMe'
Data: {
FormId: e.d etail. FormId
}
}). Then (the console log)
}



//cloud function entry file
Const cloud=the require (' wx - server - SDK)
Const {
WXMINIUser,
WXUniformMessage
}=the require (' wx - js - utils');

Const appId='wx8ce25cdc2c5478dd'; A small program that//appId
='88 e724f9a068b265ddbf3938dee5326f' const secret; A small program that//secret
Const template_id='Rq5eGHbeyzlS8KIdqySLtpXtf8nCftcC3c_CdvR15_s';//small program template message template id
Cloud. The init ()

//cloud function entry function
Exports. The main=async (event, the context)=& gt; {
Const wxContext=cloud. GetWXContext ()



//get access_token
Let wXMINIUser=new wXMINIUser ({
AppId,
Secret
});

Let access_token=await wXMINIUser. GetAccessToken ();

Const touser=wxContext. OPENID;//small program users openId, indicate the sending a message from the user, the user
Const form_id=event. FormId;//small application form form_id, or small program WeChat pay prepay_id


//send template messages
Let wXMINIUniformMessage=new WXUniformMessage ();
Let the result=await wXMINIUniformMessage. SendMessage ({
Access_token,
Touser.
Form_id,
Template_id,
Data: {

Keyword1: {
Value: 'message to remind'

},
Keyword2: {
Value: 'please timely submit today diary'

},
Keyword3: {
Value: '2020-11-24'

},
Keyword4: {
Value: 'system messages'

}
},
Page: 'pages/index/index'


})

return result;

}

  • Related