提交 5b9bc11b 编写于 作者: M mehaotian

fix(stat): getAccountInfoSync 兼容微信小程序低版本基础库

上级 9cffb293
...@@ -82,9 +82,12 @@ const getPlatformName = () => { ...@@ -82,9 +82,12 @@ const getPlatformName = () => {
}; };
const getPackName = () => { const getPackName = () => {
let packName = ''; let packName = '';
if (getPlatformName() === 'wx' || getPlatformName() === 'qq') { if (getPlatformName() === 'wx' || getPlatformName() === 'qq') {
packName = uni.getAccountInfoSync().miniProgram.appId || ''; // 兼容微信小程序低版本基础库
if(uni.canIUse('getAccountInfoSync')){
packName = uni.getAccountInfoSync().miniProgram.appId || '';
}
} }
return packName return packName
}; };
......
...@@ -78,9 +78,12 @@ export const getPlatformName = () => { ...@@ -78,9 +78,12 @@ export const getPlatformName = () => {
} }
export const getPackName = () => { export const getPackName = () => {
let packName = '' let packName = ''
if (getPlatformName() === 'wx' || getPlatformName() === 'qq') { if (getPlatformName() === 'wx' || getPlatformName() === 'qq') {
packName = uni.getAccountInfoSync().miniProgram.appId || '' // 兼容微信小程序低版本基础库
if(uni.canIUse('getAccountInfoSync')){
packName = uni.getAccountInfoSync().miniProgram.appId || '';
}
} }
return packName return packName
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册