|
|
@@ -1,10 +1,9 @@
|
|
|
package org.linlinjava.litemall.core.config;
|
|
|
|
|
|
-import org.apache.shiro.authc.AuthenticationException;
|
|
|
-import org.apache.shiro.authz.AuthorizationException;
|
|
|
-import org.apache.shiro.authz.UnauthorizedException;
|
|
|
import org.hibernate.validator.internal.engine.path.PathImpl;
|
|
|
import org.linlinjava.litemall.core.util.ResponseUtil;
|
|
|
+import org.springframework.core.Ordered;
|
|
|
+import org.springframework.core.annotation.Order;
|
|
|
import org.springframework.http.converter.HttpMessageNotReadableException;
|
|
|
import org.springframework.web.bind.MissingServletRequestParameterException;
|
|
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
|
|
@@ -18,6 +17,7 @@ import javax.validation.ValidationException;
|
|
|
import java.util.Set;
|
|
|
|
|
|
@ControllerAdvice
|
|
|
+@Order( value = Ordered.LOWEST_PRECEDENCE )
|
|
|
public class GlobalExceptionHandler {
|
|
|
|
|
|
@ExceptionHandler(IllegalArgumentException.class)
|
|
|
@@ -48,20 +48,6 @@ public class GlobalExceptionHandler {
|
|
|
return ResponseUtil.badArgumentValue();
|
|
|
}
|
|
|
|
|
|
- @ExceptionHandler(AuthenticationException.class)
|
|
|
- @ResponseBody
|
|
|
- public Object unauthenticatedHandler(AuthenticationException e) {
|
|
|
- e.printStackTrace();
|
|
|
- return ResponseUtil.unlogin();
|
|
|
- }
|
|
|
-
|
|
|
- @ExceptionHandler(AuthorizationException.class)
|
|
|
- @ResponseBody
|
|
|
- public Object unauthorizedHandler(AuthorizationException e) {
|
|
|
- e.printStackTrace();
|
|
|
- return ResponseUtil.unauthz();
|
|
|
- }
|
|
|
-
|
|
|
@ExceptionHandler(ValidationException.class)
|
|
|
@ResponseBody
|
|
|
public Object badArgumentHandler(ValidationException e) {
|