forked from tumobi/nideshop-mini-program
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (22 loc) · 625 Bytes
/
app.js
File metadata and controls
25 lines (22 loc) · 625 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
var util = require('./utils/util.js');
var api = require('./config/api.js');
var user = require('./services/user.js');
App({
onLaunch: function () {
//获取用户的登录信息
user.checkLogin().then(res => {
console.log('app login')
this.globalData.userInfo = wx.getStorageSync('userInfo');
this.globalData.token = wx.getStorageSync('token');
}).catch(() => {
});
},
globalData: {
userInfo: {
nickname: 'Hi,游客',
username: '点击去登录',
avatar: 'http://yanxuan.nosdn.127.net/8945ae63d940cc42406c3f67019c5cb6.png'
},
token: '',
}
})