mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-10-13 21:30:25 +00:00
feat: 基础脚手架更新
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform-starter</artifactId>
|
||||
<version>3.0.0.beta4</version>
|
||||
<version>3.0.0.beta5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>starter-auth</artifactId>
|
||||
|
@@ -6,7 +6,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.boot.web.servlet.filter.OrderedFilter;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
@@ -18,11 +18,10 @@ import java.io.IOException;
|
||||
* @author xxm
|
||||
* @since 2022/1/8
|
||||
*/
|
||||
@Order(value = Integer.MIN_VALUE + 1)
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
||||
public class SessionCacheFilter extends OncePerRequestFilter {
|
||||
public class SessionCacheFilter extends OncePerRequestFilter implements OrderedFilter {
|
||||
|
||||
@Override
|
||||
public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
|
||||
@@ -35,4 +34,10 @@ public class SessionCacheFilter extends OncePerRequestFilter {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return HIGHEST_PRECEDENCE+100;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author xxm
|
||||
* @since 2021/7/30
|
||||
*/
|
||||
@Validated
|
||||
@Tag(name = "认证相关")
|
||||
@RestController
|
||||
@RequestMapping("/token")
|
||||
@@ -29,7 +31,6 @@ public class TokenEndpoint {
|
||||
@Operation(summary = "普通登录")
|
||||
@PostMapping("/login")
|
||||
public Result<String> login(HttpServletRequest request, HttpServletResponse response) {
|
||||
// return Res.ok("cs");
|
||||
return Res.ok(tokenService.login(request, response));
|
||||
}
|
||||
|
||||
|
@@ -83,7 +83,8 @@ public class TokenService {
|
||||
try {
|
||||
loginSuccessHandler.onLoginSuccess(request, response, authInfoResult);
|
||||
}
|
||||
catch (Exception ignored) {
|
||||
catch (Exception exception) {
|
||||
log.error("登录成功处理出现异常: {}", exception.getMessage(), exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,7 +98,8 @@ public class TokenService {
|
||||
try {
|
||||
loginFailureHandler.onLoginFailure(request, response, e);
|
||||
}
|
||||
catch (Exception ignored) {
|
||||
catch (Exception exception) {
|
||||
log.error("登录失败处理出现异常: {}", exception.getMessage(), exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -11,7 +11,10 @@ import cn.bootx.platform.core.exception.BizInfoException;
|
||||
public class RouterCheckException extends BizInfoException {
|
||||
|
||||
public RouterCheckException() {
|
||||
super("未登录或不拥有改请求路径的请求权限");
|
||||
super("没有对应请求路径的权限");
|
||||
}
|
||||
public RouterCheckException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user