12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- 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}/st/api/weixin/appAuth?js_code=` + js_code,
- method: 'get',
- 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://broadcast.waityou24.cn',
-
-
- fileUrl: 'https://broadcast.waityou24.cn',
- },
-
- toLogin: login.toLogin,
- ...httpUtil,
- });
|