1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- import login from './utils/login'
- const app = getApp()
- import * as httpUtil from "./utils/httpUtil";
- App({
- onLaunch() {
-
- const logs = wx.getStorageSync('logs') || []
- logs.unshift(Date.now())
- wx.setStorageSync('logs', logs)
- wx.login({
- success: res => {
- const app = getApp()
- const { code: js_code } = res
-
- wx.request({
- url: `${app.globalData.publicUrl}/api/st/system/weixin/appAuth?js_code=` + js_code,
- method: "get",
- header: {
- 'x-tenant': app.globalData.tenant
- },
- success: res => {
- const { errcode, data } = res.data
- if (errcode === 0) {
- app.globalData.wxInfo = data;
- }
- },
- error: err => {
- wx.showToast({
- title: err.msg,
- icon: 'error'
- })
- }
- })
- }
- })
-
- wx.getSystemInfo({
- success: (res) => {
- this.globalData.height = res.statusBarHeight
- this.globalData.windowHeight = res.windowHeight
- }
- })
- },
- globalData: {
-
- userInfo: {},
-
- wxInfo: {},
-
- height: 0,
-
- windowHeight: 0,
-
-
- publicUrl: 'https://www.waityou24.cn',
-
- fileUrl: "http://broadcast.waityou24.cn",
-
- tenant: "test",
- },
-
- toLogin: login.toLogin,
- ...httpUtil
- })
|