微信升级为7.0.10后wx.request 400,7.0.09还是好的,什么鬼?
发布于 5 年前 作者 yanxiao 1521 次浏览 来自 问答
// 微信版本7.0.10  返回400
// 微信版本7.0.09 正常

Tool.exeRequest({
      url:"/api/msys/login",
      data:{'username':value.username,'pwd':value.pwd, 'openid': that.data.openid, 'isbind':that.data.isbind},
      success:function(data){
    }}
//Tool.exeRequest
var that = this;
  var sessionId = that.getCurrentSysUser() ? that.getCurrentSysUser().sessionId : "";
  wx.request({
    url: that.finalData.API_DOMAIN + requestConfig.url,
    data: requestConfig.data ? requestConfig.data : {},
    header: {
      "Cookie": "JSESSIONID=" + sessionId + ";SHAREJSESSIONID=" + sessionId,
      "content-type":"application/x-www-form-urlencoded"
    },
    success: function (res) {
      console.log("asdfasfasdfasdfasdfsd")
      console.log(res)
      console.log("asdfasfasdfasdfasdfsd")
      if (res.data.result == 0 || res.data.success) {
        requestConfig.success ? requestConfig.success(res.data) : "";
      } else {
        if (res.data.msg) {
          that.msg(res.data.msg);
        }
      }
    },
    fail: function (e) {
      console.log("请求失败");
      console.log(e);
      if (requestConfig.fail) {
        requestConfig.fail({ message: "系统繁忙请稍后重试" });
      }
    },
    complete: function () {
      if (requestConfig.complete) {
        requestConfig.complete();
      }
    }
  });
1 回复

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

回到顶部