微信浏览器 let ua = navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == "micromessenger"){ //是 }else{ //不是 } 判断微信小程序和开发者工具 let arr = uni.getSystemInfoSync().platform if (arr === 'mp-weixin' || arr === 'devtools') { //是 }else{ //不是 }