可否在.js里获取到project.config.json里的appid

发布于 7 年前作者 na035638 次浏览最后编辑 7 年前来自 ask

可否在.js里获取到project.config.json里的appid。求助于各位大神

2 回复
tangjing
tangjing1 楼6 年前

1.const accountInfo = wx.getAccountInfoSync();

2.console.log(accountInfo.miniProgram.appId) // 小程序 appId

参考来源小程序官方文档:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html

zhumin
zhumin2 楼5 年前

同问