From 195965a7dc46f02040e41e6747345b57f940d20d Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Sat, 20 Apr 2019 19:59:59 +0800 Subject: [PATCH] share --- public/static/common/js/common.js | 41 ++++++++++--------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index cab1a8b1e..e6d4ec827 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -1146,41 +1146,26 @@ function UrlFieldReplace(field, value, url) * @blog http://gong.gg/ * @version 1.0.0 * @datetime 2019-04-20T19:48:59+0800 - * @return {string} [weixin,weibo,qq,ios,android,pc] + * @return {string} [weixin,weibo,qq] */ function IsEnvironment() { - if(browser.versions.mobile) + var ua = navigator.userAgent.toLowerCase(); + if(ua.match(/MicroMessenger/i) == 'micromessenger') { - var ua = navigator.userAgent.toLowerCase(); - if(ua.match(/MicroMessenger/i) == 'micromessenger') - { - return 'weixin'; - } - - if(ua.match(/WeiBo/i) == 'weibo') - { - return 'weibo'; - } - - if(ua.match(/QQ/i) == 'qq') - { - return 'qq'; - } - - if(browser.versions.ios) - { - return 'ios'; - } + return 'weixin'; + } - if(browser.versions.android) - { - return 'android'; - } + if(ua.match(/WeiBo/i) == 'weibo') + { + return 'weibo'; + } - } else { - return 'pc'; + if(ua.match(/QQ/i) == 'qq') + { + return 'qq'; } + return null; } function IsWeixinss() -- GitLab