版本需求: 基础库 1.21.0 开始支持,低版本需做 兼容处理。
该 API 用于在插件中获取小程序的 appId。
const appIdRes = my.getParentAppIdSync(); console.log(appIdRes.appId);