mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-05-31 18:03:52 +08:00
双重验证码支持通过http header传入
This commit is contained in:
@@ -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())) {
|
||||
|
||||
Reference in New Issue
Block a user