小程序判定用户是否登陆

wx.checkSession({
      success: function (res) {
        // console.log("已经登陆");
        that.setData({
          "showOrHidden":'hidden',
          "contentshow": 'show'
        })
      },
      fail: function (res) {
        // console.log("需要重新登录");
        that.setData({
          "showOrHidden": 'show',
          "contentshow": 'hidden'
        })
      }
    })

猜你喜欢

转载自blog.csdn.net/Neil_1993/article/details/84633617
今日推荐