wx.request函数中fail事件中无法跳转页面
发布于 4 年前 作者 qiang08 15732 次浏览 来自 问答

代码如下:

wx.request({

      url: configUrl.loginCheck + “?mobile=” + cache.GetMobile(),

      header: { ‘content-type’: ‘application/x-www-form-urlencoded’ },

      method: ‘post’,

      success: function (res) {

        console.log(‘loginCheck-success’)

        if (res.data.toString() == “false”) {

          cache.SetMobile(’’)

          wx.navigateTo({

            url: ‘page/Register/register’

          })

        }

      },

      fail: function (res) {

        console.log(‘loginCheck-fail’)

        cache.SetMobile(’’)

        wx.navigateTo({

          url: ‘page/Register/register’

        })

      }

    })

同样的地址,success中可以跳转,但是fail中无法跳转,说app.json中没有配置该URL

回到顶部