离线定位fix
This commit is contained in:
@@ -33,7 +33,11 @@ public class GlobalExceptionHandler {
|
||||
*/
|
||||
@ExceptionHandler(ServiceException.class)
|
||||
public R handleServiceException(ServiceException e, HttpServletRequest request) {
|
||||
log.error(e.getMessage(), e);
|
||||
if ("token异常".equals(e.getMessage())) {
|
||||
log.error("用户token异常");
|
||||
} else {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
Integer code = e.getCode();
|
||||
return StringUtils.isNotNull(code) ? R.error(code, e.getMessage()) : R.error(e.getMessage());
|
||||
}
|
||||
@@ -105,7 +109,12 @@ public class GlobalExceptionHandler {
|
||||
*/
|
||||
@ExceptionHandler(CustomException.class)
|
||||
public R customException(CustomException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
if ("token异常".equals(e.getMessage())) {
|
||||
log.error("用户token异常");
|
||||
} else {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,8 +81,16 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
|
||||
@Override
|
||||
protected void doFilterInternal(@NotNull HttpServletRequest httpServletRequest, @NotNull HttpServletResponse httpServletResponse, @NotNull FilterChain filterChain) throws ServletException, IOException {
|
||||
log.info("url = {}", httpServletRequest.getRequestURI());
|
||||
|
||||
// //微信支付回调接口,不需要验证
|
||||
if ("/wx/pay/jsCallback".equals(httpServletRequest.getServletPath())) {
|
||||
filterChain.doFilter(httpServletRequest, httpServletResponse);
|
||||
return;
|
||||
}
|
||||
|
||||
// 微信公众号的请求,必须存在tenantkey,否则抛出异常
|
||||
if (httpServletRequest.getServletPath().startsWith("/wx/")) {
|
||||
|
||||
String tenantKey = httpServletRequest.getHeader("tenantkey");
|
||||
if (StrUtil.isBlank(tenantKey)) {
|
||||
resolver.resolveException(httpServletRequest, httpServletResponse, null, new CustomException("tenantkey不能为空"));
|
||||
|
||||
BIN
play-admin/src/main/resources/ip2region/ip2region.db
Normal file
BIN
play-admin/src/main/resources/ip2region/ip2region.db
Normal file
Binary file not shown.
Reference in New Issue
Block a user