添加配置文件
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice
public class ExctionConfig {
@ExceptionHandler
public Object exction(Exception exception){
exception.printStackTrace();
return SysResult.fail("服务器异常,请稍后再试");
}
}
个人记录,勿喷