收藏
回答

发布到线上有部分用户wx.request无法正常发起请求?

util.request(api.haveSite, {

      latitude: that.data.rlat,

      longitude: that.data.rlon

    }).then(res => {

      if (res.code === 0) {

        that.setData({

          siteList: res.data

        })

        if (res.data.length == 0) {

          that.setData({

            noCar: true,

            showWorkTime: false

          })

          that.getSystemInfo();

        } else {

          if ((res.data.findIndex(item => {

              return item.siteId == wx.getStorageSync('loginInfo').siteId;

            }) == -1) || app.globalData.hasLogin == false) {

            if (res.data.length == 1) {

              that.confim()

            } else {

              that.setData({

                hideFlag: true

              })

            }

          }

        }

      }

    })

在onLoad中发起请求,请求无法进入.then中,打印不出res,服务端没问题,只有部分用户不正常

最后一次编辑于  2025-07-09
回答关注问题邀请回答
收藏

1 个回答

  • Mr.Zhao
    Mr.Zhao
    2025-07-08

    你这代码还不如不发,一点用都没有

    2025-07-08
    有用
    回复
登录 后发表内容