Files
fitness-coach/miniprogram/app.js
wm b3b58e66fb feat: init fitness-coach (backend + miniprogram)
- backend: NestJS service with exercise/plan data
- miniprogram: WeChat mini program client
- exclude node_modules, dist, runtime data-store, local env
2026-07-22 00:35:40 +08:00

27 lines
743 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { BASE_URL } = require('./config');
App({
globalData: {
// 状态栏高度px由 onLaunch 读取,供自定义导航栏计算顶部留白
statusBarHeight: 20,
// 后端基础地址
baseUrl: BASE_URL
},
onLaunch() {
// 读取窗口信息以获取状态栏高度(兼容新旧 API
try {
const info = (typeof wx.getWindowInfo === 'function')
? wx.getWindowInfo()
: wx.getSystemInfoSync();
this.globalData.statusBarHeight = info.statusBarHeight || 20;
} catch (e) {
this.globalData.statusBarHeight = 20;
}
// 可选:静默登录(占位,不请求真实后端)
// const { getOpenid } = require('./utils/auth');
// getOpenid();
}
});