找到原因了,是前端小程序用错了appid ,所以formId 是无效的
invalid form id hint调用微信发送模板通知接口报错{"errcode":41028,"errmsg":"invalid form id hint: [Z.gJga09194105]"} ,请求各位大神解决。[图片]
2019-01-24我也遇到这个问题了,不知道这么解决
各位这个问题怎么解决?模板41028{errcode: 41028, errmsg: "invalid form id hint: [1pwgKa02394120]"} [代码]testSubmit: function(e) {[代码][代码] [代码][代码]console.log(e,"===")[代码][代码] [代码][代码]var self = this;[代码][代码] [代码][代码]wx.login({[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]wx.request({[代码][代码] [代码][代码]url: 'https://api.weixin.qq.com/sns/jscode2session?appid=' + 'wx58b7b8691fefde0a' + '&&secret=' + 'd8fc503b909a40eefc9a3b3471636ddd' + '&&js_code=' + res.code + '&&grant_type=' + 'authorization_code',[代码][代码] [代码][代码]method: 'GET',[代码][代码] [代码][代码]header: {[代码][代码] [代码][代码]'Content-Type': 'application/json'[代码][代码] [代码][代码]},[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]var openid = res.data.openid;[代码][代码] [代码][代码]wx.request({[代码][代码] [代码][代码]url: 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid= wx58b7b8691fefde0a&secret=d8fc503b909a40eefc9a3b3471636ddd',[代码][代码] [代码][代码]method: 'GET',[代码][代码] [代码][代码]header: {[代码][代码] [代码][代码]'Content-Type': 'application/json'[代码][代码] [代码][代码]},[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]self.data._access_token = res.data.access_token;[代码] [代码] [代码][代码]let _jsonData = {[代码][代码] [代码][代码]"access_token": self.data._access_token,[代码][代码] [代码][代码]"touser": openid,[代码][代码] [代码][代码]"page": "index",[代码][代码] [代码][代码]"form_id": "FORMID",[代码][代码] [代码][代码]"template_id": 'xyM8GiLLiZVw1iJGy3HrrWPHqFIaDcobM27H2FvVB7Y',[代码][代码] [代码][代码]"data": {[代码][代码] [代码][代码]"keyword1": {[代码][代码] [代码][代码]"value": "TIT造舰快递",[代码][代码] [代码][代码]"color": "#173177"[代码][代码] [代码][代码]},[代码][代码] [代码][代码]"keyword2": {[代码][代码] [代码][代码]"value": "2019年01月12日",[代码][代码] [代码][代码]"color": "#173177"[代码][代码] [代码][代码]},[代码][代码] [代码][代码]"keyword3": {[代码][代码] [代码][代码]"value": "2019年01月9日",[代码][代码] [代码][代码]"color": "#173177"[代码][代码] [代码][代码]},[代码][代码] [代码][代码]"keyord4": {[代码][代码] [代码][代码]"value": "电风扇",[代码][代码] [代码][代码]"color": "#173177"[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]wx.request({[代码][代码] [代码][代码]url: 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=' + self.data._access_token,[代码][代码] [代码][代码]data: _jsonData,[代码][代码] [代码][代码]method: 'post',[代码][代码] [代码][代码]success: function (res) {[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: function (err) {[代码][代码] [代码][代码]console.log('request fail ', err);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]complete: function (res) {[代码][代码] [代码][代码]console.log("request completed!");[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]})[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]},[代码]
2019-01-17