// app.js import { handleAppLaunch } from './utils/app-init' App({ globalData: { userInfo: null, hasUserInfo: false, canIUse: wx.canIUse('button.open-type.getUserInfo'), canIUseGetUserProfile: false, canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') }, onLaunch(options) { // 处理启动参数,包括邀请码 handleAppLaunch(options) if (wx.getUserProfile) { this.globalData.canIUseGetUserProfile = true } } })