Merge branch 'main' into personal/heshunme/auth-restart-1

This commit is contained in:
高子兴 2024-07-02 02:29:32 +08:00
commit 3137c22313

View File

@ -0,0 +1,15 @@
package org.cmh.backend.Utils;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
@ControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(JwtValidationException.class)
public ResponseEntity<Object> handleJwtInvalidException(JwtValidationException ex) {
return new ResponseEntity<>(HttpStatus.UNAUTHORIZED);
}
}