- 微信小程序接口调用Provisional headers are shown
有的手机可以 有的不可以 随机 错误截图: [图片] console:没有任何fail输出 [图片] 域名检测: 合法域名已配 [图片] 代码片段: wx.login({ success: function (res) { if (res.code) { console.log('===自动登录小程序返回状态==', res); var param1 = { grant_type: "authorization_code", code: res.code } jsonApi.getData('getOpenId', param1, (data1) => { }) }else{ wx.showToast({ title: 'code未获取请重新登录', icon: 'none', duration: 2000 //持续的时间 }) return; } } }); getData代码封装: const getData = (actionUrl, params, callback, method) => { var headers = globalData.header; headers.openId = wx.getStorageSync('openId'); var postUrl = ''; var requstMethod = 'POST'; if (actionUrl.indexOf('im20') != -1) { postUrl = actionUrl; } else { postUrl = apiurl + actionUrl; } wx.showToast({ title: '加载中...', icon: 'loading', }); console.log('#########' + actionUrl + '############接口名称:', actionUrl); console.log('*********' + actionUrl + '***********接口头文件:', headers); console.log('========' + actionUrl + '=============接口参数:', params); wx.request({ method: requstMethod, header: headers, url: postUrl, data: params, success: (res) => { wx.hideToast({ success: (res) => {}, }) console.log('%%%%%%%%%%%%%%%%%%%%%%返回参数:', res.data) callback(res.data) }, fail(error) { console.log('fail') console.log('%%%%%%%%%%%%%%%%%%%%%%请求失败:', error) } }) }
2022-12-29 - 服务器发送小程序信息乱码 本地没事 这是为什么?
[图片]
2021-01-22 - 发送小程序信息 本机正常 服务器就发送失败 这是怎么回事?
错误码如下: [ "com.airport.hb_airport.vo.ErrMeg" { errcode:"40058" errmsg:"miniprogram_notice.title exceed min chinese words 4. Invalid input invalid Request Parameter, hint: [1611296337_149_009357493e97c457a3256c80d3d68cf2], from ip: , more info at https://open.work.weixin.qq.com/devtool/query?e=40058" invaliduser:null invalidparty:null invalidtag:null } ] 请求信息 如下: [ "com.airport.hb_airport.vo.SendMessage" { touser:null toparty:"10" totag:null msgtype:"miniprogram_notice" agentid:0 text:null image:null voice:null video:null file:null textcard:null news:null mpnews:null markdown:null miniprogram_notice:[ "com.airport.hb_airport.vo.MiniprogramNotice" { appid:"**" page:"page/notice/notice" title:"整改通知" description:"2021-01-22 14:18:56" emphasis_first_item:null content_item:[ "java.util.ArrayList" [ [ "com.airport.hb_airport.vo.ContentItem" { key:"内容" value:"您有一条新的整改通知,请进入小程序查看" } ] ] ] } ] taskcard:null safe:0 enable_id_trans:0 } ]
2021-01-22 - 发送小程序通知 测试没问题 到服务器就发送失败
错误码如下: "com.airport.hb_airport.vo.ErrMeg" { errcode:"40058" errmsg:"miniprogram_notice.title exceed min chinese words 4. Invalid input invalid Request Parameter, hint: [1611296337_149_009357493e97c457a3256c80d3d68cf2], from ip: , more info at https://open.work.weixin.qq.com/devtool/query?e=40058" invaliduser:null invalidparty:null invalidtag:null } 发送请求如下: [ "com.airport.hb_airport.vo.SendMessage" { touser:null toparty:"10" totag:null msgtype:"miniprogram_notice" agentid:0 text:null image:null voice:null video:null file:null textcard:null news:null mpnews:null markdown:null miniprogram_notice:[ "com.airport.hb_airport.vo.MiniprogramNotice" { appid:"***" page:"page/notice/notice" title:"整改通知" description:"2021-01-22 14:18:56" emphasis_first_item:null content_item:[ "java.util.ArrayList" [ [ "com.airport.hb_airport.vo.ContentItem" { key:"内容" value:"您有一条新的整改通知,请进入小程序查看" } ] ] ] } ] taskcard:null safe:0 enable_id_trans:0 } ]
2021-01-22