16 Star 48 Fork 6

我奋斗去了/a-starbucks

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
app.js 799 Bytes
一键复制 编辑 原始数据 按行查看 历史
baipeng 提交于 2017-08-18 22:11 . 提交代码
App({
onLaunch() {
const { data } = my.getStorageSync({ key: 'logs' });
const logs = data && data.logs ? data.logs : [];
my.setStorageSync({
key: 'logs',
data: {
logs: logs.concat([Date.now()]),
},
});
},
getUserInfo(cb) {
if (this.globalData.userInfo) {
typeof cb === 'function' && cb(this.globalData.userInfo);
} else {
my.getAuthCode({
scopes: 'auth_user',
success: (authcode) => {
console.log(authcode);
my.getAuthUserInfo({
success: (userInfo) => {
this.globalData.userInfo = userInfo;
typeof cb === 'function' && cb(this.globalData.userInfo);
},
});
},
});
}
},
globalData: {
userInfo: null,
},
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/William__Bai/a-starbucks.git
git@gitee.com:William__Bai/a-starbucks.git
William__Bai
a-starbucks
a-starbucks
master

搜索帮助

Cb406eda 1850385 E526c682 1850385