19 lines
537 B
Java
19 lines
537 B
Java
package com.springboot.handler;
|
|
|
|
import org.apache.shiro.authz.AuthorizationException;
|
|
import org.springframework.core.Ordered;
|
|
import org.springframework.core.annotation.Order;
|
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
|
|
|
|
@ControllerAdvice
|
|
@Order(value = Ordered.HIGHEST_PRECEDENCE)
|
|
public class GlobalExceptionHandler {
|
|
|
|
@ExceptionHandler(value = AuthorizationException.class)
|
|
public String handleAuthorizationException() {
|
|
return "403";
|
|
}
|
|
}
|