判断是微信环境还是浏览器环境

 this.is_weixin = (function() {
      const ua = navigator.userAgent.toLowerCase();
      if (ua.match(/MicroMessenger/i) == "micromessenger") {
        return true;
      } else {
        return false;
      }
    })();
posted @ 2021-05-14 14:20  起风了1573  阅读(106)  评论(0)    收藏  举报