| 1234567891011121314151617181920212223242526272829303132333435 |
- import './utils/system/index'
- import './services/index' // 初始化服务
- App({
- globalData: {
- /// iPhone底部安全区域
- safeBottom: 0.0,
- /// 窗口高度
- windowHeight: 0,
- },
- onLaunch() {
- /// 获取iPhone底部安全区域
- wx.getSystemInfo({
- success: res=> {
- this.globalData.safeBottom = res.screenHeight-res.safeArea.bottom
- this.globalData.windowHeight = res.windowHeight
- },
- fail: () => {}
- })
- // 展示本地存储能力
- const logs = wx.getStorageSync('logs') || []
- logs.unshift(Date.now())
- wx.setStorageSync('logs', logs)
- // 登录
- wx.login({
- success: res => {
- console.log(res)
- // 发送 res.code 到后台换取 openId, sessionKey, unionId
- },
- })
- },
- })
|