Browse Source

spring-boot-demo-rbac-security 完成

pull/1/head
Yangkai.Shen 5 years ago
parent
commit
17d2867f54
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      spring-boot-demo-rbac-security/src/main/java/com/xkcoding/rbac/security/util/ResponseUtil.java

+ 2
- 2
spring-boot-demo-rbac-security/src/main/java/com/xkcoding/rbac/security/util/ResponseUtil.java View File

@@ -43,7 +43,7 @@ public class ResponseUtil {
// FIXME: hutool 的 BUG:JSONUtil.toJsonStr()
// 将JSON转为String的时候,忽略null值的时候转成的String存在错误
response.getWriter()
.write(JSONUtil.toJsonStr(new JSONObject(ApiResponse.ofStatus(status, data), true)));
.write(JSONUtil.toJsonStr(new JSONObject(ApiResponse.ofStatus(status, data), false)));
} catch (IOException e) {
log.error("Response写出JSON异常,", e);
}
@@ -65,7 +65,7 @@ public class ResponseUtil {
// FIXME: hutool 的 BUG:JSONUtil.toJsonStr()
// 将JSON转为String的时候,忽略null值的时候转成的String存在错误
response.getWriter()
.write(JSONUtil.toJsonStr(new JSONObject(ApiResponse.ofException(exception), true)));
.write(JSONUtil.toJsonStr(new JSONObject(ApiResponse.ofException(exception), false)));
} catch (IOException e) {
log.error("Response写出JSON异常,", e);
}


Loading…
Cancel
Save