Skip to content

Commit

Permalink
feishu
Browse files Browse the repository at this point in the history
  • Loading branch information
getrebuild committed Dec 3, 2024
1 parent 7db211a commit 93972ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/rebuild/web/user/signup/LoginChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ public enum LoginChannel {
PC_DINGTALK("PC钉钉"),
PC_WECOM("PC企业微信"),
PC_WECHAT("PC微信"),
PC_FEISHU("PC飞书"),
PC_DESKTOP("PC桌面"),

MOB_WEB("手机浏览器"),
MOB_DINGTALK("手机钉钉"),
MOB_WECOM("手机企业微信"),
MOB_WECHAT("手机微信"),
MOB_FEISHU("手机飞书"),
MOB_ANDROID("手机APP"),
MOB_IOS("iOS APP"), // 保留

Expand Down Expand Up @@ -64,12 +66,14 @@ public static LoginChannel parse(String userAgent, boolean forceH5) {
boolean isDingtalk = userAgent.contains("DINGTALK");
boolean isWecom = userAgent.contains("WXWORK");
boolean isWechat = !isWecom && userAgent.contains("MICROMESSENGER");
boolean isFeishu = userAgent.contains("LARK");
boolean isH5PlusApp = userAgent.contains("HTML5PLUS");

if ((OS != null && OS.getDeviceType() == DeviceType.MOBILE) || forceH5) {
if (isDingtalk) return MOB_DINGTALK;
else if (isWecom) return MOB_WECOM;
else if (isWechat) return MOB_WECHAT;
else if (isFeishu) return MOB_FEISHU;
else if (isH5PlusApp) return MOB_ANDROID;
return MOB_WEB;
}
Expand All @@ -79,6 +83,7 @@ public static LoginChannel parse(String userAgent, boolean forceH5) {
if (isDingtalk) return PC_DINGTALK;
else if (isWecom) return PC_WECOM;
else if (isWechat) return PC_WECHAT;
else if (isFeishu) return PC_FEISHU;
else if (isDesktop) return PC_DESKTOP;
return PC_WEB;
}
Expand Down

0 comments on commit 93972ef

Please sign in to comment.