From 6c9ff99f368a14932eef46a4f33a812e4f6188f6 Mon Sep 17 00:00:00 2001 From: zhouhao Date: Mon, 10 Dec 2018 15:59:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=8C=E9=87=8D=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87http=20header=E4=BC=A0?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/twofactor/TwoFactorHandlerInterceptorAdapter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/twofactor/TwoFactorHandlerInterceptorAdapter.java b/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/twofactor/TwoFactorHandlerInterceptorAdapter.java index 59c667c22..db6fe085e 100644 --- a/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/twofactor/TwoFactorHandlerInterceptorAdapter.java +++ b/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/twofactor/TwoFactorHandlerInterceptorAdapter.java @@ -41,6 +41,9 @@ public class TwoFactorHandlerInterceptorAdapter extends HandlerInterceptorAdapte return true; } String code = request.getParameter(factor.parameter()); + if (code == null) { + code = request.getHeader(factor.parameter()); + } if (StringUtils.isEmpty(code)) { throw new NeedTwoFactorException("需要进行双重验证", factor.provider()); } else if (!validator.verify(code, factor.timeout())) {