mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 支付宝小程序
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.jsowell.common;
|
||||
|
||||
import com.jsowell.common.enums.adapay.AdapayPayChannelEnum;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class UserAgentUtils {
|
||||
|
||||
/**
|
||||
* 判断请求来自哪里
|
||||
*/
|
||||
public static String determineRequestSource(HttpServletRequest request) {
|
||||
String userAgent = request.getHeader("user-agent");
|
||||
if (StringUtils.isBlank(userAgent)) {
|
||||
return null;
|
||||
}
|
||||
if (userAgent.contains("AlipayClient")) {
|
||||
return AdapayPayChannelEnum.ALIPAY_LITE.getValue();
|
||||
}else if (userAgent.contains("MicroMessenger")) {
|
||||
return AdapayPayChannelEnum.WX_LITE.getValue();
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user