1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
epp/miniprogram/app.js

26 lines
490 B
JavaScript

// app.js
App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
wx.authorize({
scope: 'scope',
})
},
// 全局变量
globalData: {
baseUrl: "http://localhost:8080", // 不带最后的 /
userInfo: null
}
})