diff --git a/utils/src/main/kotlin/cn/tursom/utils/Tools.kt b/utils/src/main/kotlin/cn/tursom/utils/Tools.kt index cc39111..4fb931a 100644 --- a/utils/src/main/kotlin/cn/tursom/utils/Tools.kt +++ b/utils/src/main/kotlin/cn/tursom/utils/Tools.kt @@ -24,7 +24,7 @@ val prettyGson = GsonBuilder() .create() fun Any.toJson(): String = gson.toJson(this) -fun Any.toPrettyJson(): String = gson.toJson(this) +fun Any.toPrettyJson(): String = prettyGson.toJson(this) inline fun String.fromJson(): T = gson.fromJson(this, T::class.java) inline fun Gson.fromJson(json: String) = this.fromJson(json, T::class.java)!!