部分机型wx.request返回错误状态码400
发布于 6 年前 作者 chengchao 5695 次浏览 来自 问答

urlmodel = requestUrl + “PostShipBySapCode?sapcodelist=” + JSON.stringify(that.data.Listmodel) + “&sapLink=” + app.globalData.userno + “&LONGITUDE=” + that.data.longitude + “&LATITUDE=” + that.data.latitude + “&LOCATIONADDRESS=” + that.data.locationAddress

  wx.request({

      url: urlmodel,

      data: { },

      method: “POST”,

      header: {

        ‘content-type’: ‘application/json’

      },

      success: function (res) {

        //console.log(“123”);

        console.log(res);

        if (res.statusCode == 200) {

          var data = JSON.parse(res.data);

          if (data.errcode != ‘00’) {

            wx.showToast({

              title: data.errmsg,

              icon: ‘none’,

              duration: 2000

            })

          } else {

            wx.showToast({

              title: data.errmsg,

              icon: ‘success’,

              duration: 5000

            })

 

          }

        } else {

 

          wx.showModal({

            title: ‘提示’,

            content: ‘服务器返回状态码’+res.statusCode,

            success: function (res) {

              if (res.confirm) {

               return;

              } else {

                return;

              }

            }

          })

          return;

        }

      }

    })

回到顶部