12345678910111213141516171819202122232425262728293031323334353637 |
- import login from './utils/login'
- import * as httpUtil from "./utils/httpUtil";
- const app = getApp()
- App({
- onLaunch() {
- // 展示本地存储能力
- const logs = wx.getStorageSync('logs') || []
- logs.unshift(Date.now())
- wx.setStorageSync('logs', logs)
- //获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度
- wx.getSystemInfo({
- success: (res) => {
- this.globalData.client = {
- // 窗口宽度和高度
- windowWidth: res.windowWidth,
- windowHeight: res.windowHeight,
- // 状态栏高度
- statusBarHeight: res.statusBarHeight
- }
- }
- })
- },
- globalData: {
- userInfo: {},
- // 微信用户openid,sessionKey
- wxInfo: {},
- client: {},
- publicUrl: 'https://broadcast.waityou24.cn',
- // 图片请求接口
- fileUrl: "http://broadcast.waityou24.cn",
- // 图片显示接口
- imageUrl: "http://broadcast.waityou24.cn",
- },
- // 微信openid回调
- toLogin: login.toLogin,
- ...httpUtil
- })
|