增加微信小程序的登陆的测试代码

This commit is contained in:
YunaiV
2021-10-30 10:09:31 +08:00
parent 038c0b87b9
commit 8dbd6143bf
26 changed files with 381 additions and 20 deletions

19
mini-program-test/app.js Executable file
View File

@ -0,0 +1,19 @@
// 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
}
})
},
globalData: {
userInfo: null
}
})