-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
37 lines (32 loc) · 1.02 KB
/
app.js
File metadata and controls
37 lines (32 loc) · 1.02 KB
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
33
34
35
36
37
//app.js
App({
globalData: {
token: '', //session token
statusOpenBind: false, //开发者账号是否已经登录
wxUserInfo: null, //微信授权后的scope信息
statusScopeUser: null, //是否已经微信授权
appId: null, //乐橙开放平台开发者appid
appSecret: null, //乐橙开放平台开发者appsecret
videoListRefresh:true//默认每次点击”我的视频“都刷新设备列表页面,除了从视频播放页面返回不刷新
},
onLaunch: function () {
//进入授权判断页面
this.checkWxUserInfo()
},
checkWxUserInfo() {
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
this.globalData.statusScopeUser = true
console.log("微信用户已经授权")
} else {
this.globalData.statusScopeUser = false
console.log("微信用户未经授权")
}
if (this.wxUserScopeReadyCallback) {
this.wxUserScopeReadyCallback(res)
}
}
})
}
})