app.globalData为undefined?
var app = get App()
为什么console.log(app)
打印值为 pe{}. 里面没有globalData属性
4 回复
const app = getApp() getun(inf) { let that = this let params2 = { url: '/user/login' , data: { data: inf.detail.encryptedData, iv: inf.detail.iv, chn: 'wxmini' , from: 'wxmini' }, } http(params2).then(res => { if (res.code == 99) { that.data.loginFlag = false that.setData({ loginFlag: that.data.loginFlag }) } else if (res.code == 0) { wx.setStorageSync( 'token' , res.data.session_id) console.log(app) wx.setStorageSync( 'is_diamond' , res.data.is_diamond) app.globalData.is_diamond = res.data.is_diamond this .getuseTag() } else { wx.showToast({ title: '请重试' , icon: 'none' }) } }) }, |
App({ globalData: { is_diamond:0, userInfo: null , |
为什么打印出来不是 {}而是pe{}
pe{}这种情况 什么时候会出现
{}又是什么情况下会出现