From 007ab5d3aa3ad111f57b28ee23261ff472f73fae Mon Sep 17 00:00:00 2001 From: ronger Date: Mon, 23 May 2022 09:50:27 +0800 Subject: [PATCH] :arrow_up: fastjson v2 --- pom.xml | 6 +++++- src/main/java/com/rymcu/forest/config/ShiroLoginFilter.java | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8d90720..ea0eb05 100644 --- a/pom.xml +++ b/pom.xml @@ -101,7 +101,7 @@ com.alibaba fastjson - 1.2.79 + 2.0.3 @@ -241,6 +241,10 @@ com.google.guava guava + + org.json + json + diff --git a/src/main/java/com/rymcu/forest/config/ShiroLoginFilter.java b/src/main/java/com/rymcu/forest/config/ShiroLoginFilter.java index 6f6d87d..babf323 100644 --- a/src/main/java/com/rymcu/forest/config/ShiroLoginFilter.java +++ b/src/main/java/com/rymcu/forest/config/ShiroLoginFilter.java @@ -2,6 +2,7 @@ package com.rymcu.forest.config; import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; import com.rymcu.forest.core.result.GlobalResultGenerator; import org.apache.shiro.web.filter.authc.FormAuthenticationFilter; import org.slf4j.Logger; @@ -51,7 +52,7 @@ public class ShiroLoginFilter extends FormAuthenticationFilter { httpServletResponse.setCharacterEncoding("UTF-8"); httpServletResponse.setHeader("sessionstatus", "timeOut"); httpServletResponse.addHeader("loginPath", this.getLoginUrl()); - httpServletResponse.getWriter().write(JSONObject.toJSONString(GlobalResultGenerator.genErrorResult("未登录或已登录超时,请重新登录"),true)); + httpServletResponse.getWriter().write(JSONObject.toJSONString(GlobalResultGenerator.genErrorResult("未登录或已登录超时,请重新登录"), SerializerFeature.PrettyFormat)); return false; }else { if (log.isTraceEnabled()) {