update 生产环境开启谷歌验证

This commit is contained in:
yyb
2026-01-09 13:36:11 +08:00
parent 4ff004f2ac
commit 267c79152c
7 changed files with 75 additions and 86 deletions

View File

@@ -48,11 +48,10 @@ public class LoginInterceptor implements HandlerInterceptor {
if (loginRequired == null) {
loginRequired = handlerMethod.getBeanType().getAnnotation(LoginRequired.class);
}
String token = request.getHeader(AUTHENTICATION);
// 如果没有注解或者注解值为true则校验token
if (loginRequired == null || loginRequired.value()) {
String token = request.getHeader(AUTHENTICATION);
if (token == null || !isValidToken(token)) {
if (loginRequired == null || loginRequired.value() || token != null) {
if (!isValidToken(token)) {
throw new AuthException("用户未登录");
}
}