收藏
回答

部分手机不能使url功能

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.request 微信安卓客户端 8.0.56 3.5.2
wx.request({
            url:loginUrl,
            data: JSON.stringify({
              "userName": userName,
              "password": userPassword
            }),
            method"post",
            success(res) {
              console.log("调用成功时间"+Date.now())
              console.log("调用成功时间"+new Date())
              console.log(res)
              if (res.data.code == 100) {
                wx.showToast({
                  title: res.data.msg,
                  icon'none'
                })
                if (remeber) {
                  wx.setStorage({
                    key"userName",
                    data: userName
                  })
                  wx.setStorage({
                    key"userPassword",
                    data: userPassword
                  })
                  wx.setStorage({
                    key"remeber",
                    data: remeber
                  })
                } else {
                  wx.setStorage({
                    key"userName",
                    data''
                  })
                  wx.setStorage({
                    key"userPassword",
                    data""
                  })
                  wx.setStorage({
                    key"remeber",
                    data: remeber
                  })
                }
                _this.setData({
                  loginData: res,
                })
                getApp().globalData.loginData = res;
                if (getApp().globalData.loginData.data.code === 100) {
                  setTimeout(function () {
        
                    wx.switchTab({
                      url'../index/index'
                    })
                  }, 2000//延迟时间
                
                }
              } else {
                wx.showToast({
                  title: res.data.msg,
                  icon'none'
                })
              }
            },


            fail(res) {
              console.log("调用失败时间"+Date.now());
              console.log("调用失败时间"+new Date())
              wx.showToast({
                title: res.errMsg,
                icon'none'
              })
              console.log(res)


            },


          })
回答关注问题邀请回答
收藏

2 个回答

  • 社区技术运营专员--Demons
    社区技术运营专员--Demons
    01-17

    请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    01-17
    有用
    回复
  • 小黎
    小黎
    01-17

    惜字如金啊,没看懂你想表达啥

    01-17
    有用
    回复
登录 后发表内容