Browse Source

解决handleError返回结果中文乱码的问题

sunyj 8 years ago
parent
commit
dce6641a6d

+ 1 - 0
src/main/java/com/uas/report/core/advice/ExceptionHandlerAdvice.java

@@ -124,6 +124,7 @@ public class ExceptionHandlerAdvice {
 	 * @throws IOException
 	 */
 	public static void handleError(HttpServletResponse response, Integer status, String message) throws IOException {
+		response.setHeader("Content-type", "text/html;charset=UTF-8");
 		response.setStatus(status);
 		JSONObject jsonObject = new JSONObject();
 		jsonObject.put("success", false);