飞狐爷

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
var session_id = wx.getStorageSync('session_id');
        var header = { 'content-type': 'application/x-www-form-urlencoded', 'Cookie': 'PHPSESSID=' + session_id };
        wx.request({
          url: app.globalData.requestUrl,
          data: {},
          method: 'POST', 
          header: header,
          success: function (res) {
            console.log(res);
            if (res.data.status == 1) {

            } else {
              wx.showToast({
                title: '读取手机号失败',
                image: app.globalData.wrongSrc,
                duration: 2000
              })
            }
          },
          fail: function () {
            wx.showToast({
              title: '获取失败',
              image: app.globalData.wrongSrc,
              duration: 2000
            })
          }

        })

 

posted on 2018-01-23 18:14  飞狐爷  阅读(268)  评论(0编辑  收藏  举报