my.getparentappidsync 用于在插件中获取小程序的 appid。
基础库 2.7.17 开始提供 my.getaccountinfosync ,可在插件中获取小程序的 appid,并同时获取小程序以及插件的版本号。
版本要求: 基础库 1.21.0 开始支持,低版本需做 兼容处理。
属性类型说明appidstring使用该插件的小程序 appid。"}" id="2b5d815b">
属性 | 类型 | 说明 |
appid | string | 使用该插件的小程序 appid。 |
const appidres = my.getparentappidsync(); console.log(appidres.appid);