Skip to content

Commit 2740ebe

Browse files
author
Janche
committed
🐛 修改异常返回的请求头信息
1 parent d6da867 commit 2740ebe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/src/main/java/com/example/janche/common/exception/ControllerExceptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class ControllerExceptionHandler {
3737
@ExceptionHandler(Exception.class)
3838
public void handleCustomException(Exception e, HttpServletResponse response) {
3939
response.setCharacterEncoding("UTF-8");
40-
response.setContentType("text/html;charset=UTF-8");
40+
response.setContentType("application/json;charset=UTF-8");
4141
PrintWriter writer = null;
4242
RestResult result = null;
4343
if (e instanceof CustomException){

0 commit comments

Comments
 (0)