uniapp开发公众号项目判断是否在微信浏览器中打开
·
判断是否在微信浏览器中打开访问公众号:
// 判断是否为微信浏览器
export const ifWXWEB = () => {
// #ifdef H5
const userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf('micromessenger') !== -1) {
// console.log('当前页面在微信中打开');
return true
} else {
// console.log('当前页面不在微信中打开');
return false
}
// #endif
return false
}
更多推荐



所有评论(0)