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 }) } })