diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index cab1a8b1efc10b9f7d0f8d8cf2ebe9aad7ee2fed..e6d4ec82726b0fa0ea41b290b9cb03b186374eb5 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()