mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-06-29 13:37:49 +08:00
Compare commits
4 Commits
b83f93735c
...
8c6874dd34
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c6874dd34 | ||
|
|
41fd16e5d3 | ||
|
|
2877bde26a | ||
|
|
8e32f17e6e |
@ -59,7 +59,7 @@ services:
|
||||
networks:
|
||||
- media-net
|
||||
ports:
|
||||
#- "6080:80/tcp" # [播流]HTTP 安全考虑-非测试阶段需要注释掉,改为由nginx代理播流地址
|
||||
- "80:80/tcp" # [播流]HTTP 安全考虑-非测试阶段需要注释掉,改为由nginx代理播流地址
|
||||
#- "4443:443/tcp" # [播流]HTTPS 安全考虑-非测试阶段需要注释掉,改为由nginx代理播流地址
|
||||
- "${MediaRtmp:-10935}:${MediaRtmp:-10935}/tcp" # [收流]RTMP
|
||||
- "${MediaRtmp:-10935}:${MediaRtmp:-10935}/udp" # [收流]RTMP
|
||||
|
||||
@ -11,6 +11,7 @@ import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
||||
import org.springframework.web.servlet.resource.NoResourceFoundException;
|
||||
|
||||
/**
|
||||
@ -32,13 +33,24 @@ public class GlobalExceptionHandler {
|
||||
return WVPResult.fail(ErrorCode.ERROR500.getCode(), e.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认异常处理
|
||||
* @param e 异常
|
||||
* @return 统一返回结果
|
||||
*/
|
||||
@ExceptionHandler(MaxUploadSizeExceededException.class)
|
||||
@ResponseStatus(HttpStatus.FORBIDDEN)
|
||||
public WVPResult<String> exceptionHandler(MaxUploadSizeExceededException e) {
|
||||
return WVPResult.fail(ErrorCode.ERROR403.getCode(), "文件过大");
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认异常处理
|
||||
* @param e 异常
|
||||
* @return 统一返回结果
|
||||
*/
|
||||
@ExceptionHandler(NoResourceFoundException.class)
|
||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||
@ResponseStatus(HttpStatus.NOT_FOUND)
|
||||
public WVPResult<String> exceptionHandler(NoResourceFoundException e) {
|
||||
return WVPResult.fail(ErrorCode.ERROR404);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user