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())) {