-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
32 lines (32 loc) · 840 Bytes
/
app.js
File metadata and controls
32 lines (32 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// app.js
App({
globalData:{
userInfo:'',
system: '',//导航栏信息
capsule: '',
token:'',
userId:'',
refresh:0
},
onLaunch: function () {
this.globalData.userInfo=wx.getStorageSync('userInfo')//获取本地用户信息
if(this.globalData.userInfo!=''){
this.globalData.userInfo.highTag--
this.globalData.userInfo.mbti--
this.globalData.userInfo.constellation--
}
this.globalData.token=wx.getStorageSync('token')
this.globalData.userId=wx.getStorageSync('userId')
// 在 app.js 中全局获取一次系统和胶囊信息
// 获取系统信息
wx.getSystemInfo({
success: res => {
this.globalData.system = res
console.log(res)
}
})
// 获取胶囊信息
this.globalData.capsule = wx.getMenuButtonBoundingClientRect()
}
}
)