-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
34 lines (34 loc) · 739 Bytes
/
app.js
File metadata and controls
34 lines (34 loc) · 739 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
33
34
// app.js
App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || [];
logs.unshift(Date.now());
wx.setStorageSync('logs', logs);
wx.cloud.init({
env: 'enspire-env-7gn7r6ekad6dfbe4',
traceUser: true,
});
wx.cloud.init({
env: 'enspire-env-7gn7r6ekad6dfbe4',
});
// 登录
wx.login({
success: (res) => {
wx.cloud.callFunction({
name: 'getopenid',
success: (res) => {
console.log(res.result.openid);
wx.setStorage({
key: 'openid',
data: res.result.openid,
});
},
});
},
});
},
globalData: {
userInfo: null,
},
});