1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 06:33:48 +00:00

repair wechat bug (#4150)

This commit is contained in:
杨顺强
2019-10-15 10:16:48 +08:00
committed by Daniel Pan
parent 1790940bc8
commit 295decc039
3 changed files with 21 additions and 4 deletions

View File

@@ -38,6 +38,13 @@ export const Utils = {
return window.innerWidth >= 768;
},
isWeChat: function() {
let ua = window.navigator.userAgent.toLowerCase();
let isWeChat = ua.match(/MicroMessenger/i) == 'micromessenger';
let isEnterpriseWeChat = ua.match(/MicroMessenger/i) == 'micromessenger' && ua.match(/wxwork/i) == 'wxwork';
return isEnterpriseWeChat || isWeChat;
},
FILEEXT_ICON_MAP: {
// text file