-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.js
44 lines (43 loc) · 1.03 KB
/
app.js
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
38
39
40
41
42
43
44
/**
* v0.0.1 仿Q
*
* 后续计划:
* 1、完善音乐播放器(情绪音乐播放器升级至v0.0.5)
* 2、增加看点功能功能
* 3、增加同城服务功能
*
* 精彩继续,敬请关注
*
* 欢迎访问: http://www.zhixingai.ren
* 开源地址: https://github.com/hank583746309
* http://git.oschina.net/laohuangshu
*
* @author 老皇叔(QQ:2219510983)
* @date 2016.10.20
*/
App({
onLaunch: function () {
},
getUserInfo:function(cb){
var that = this
if(this.globalData.userInfo){
typeof cb == "function" && cb(this.globalData.userInfo)
}else{
//调用登录接口
wx.login({
success: function () {
wx.getUserInfo({
success: function (res) {
that.globalData.userInfo = res.userInfo
typeof cb == "function" && cb(that.globalData.userInfo)
}
})
}
})
}
},
globalData:{
userInfo:null,
host : 'http://www.zhixingai.ren/'
}
})