Skip to content

Commit 74eb7a7

Browse files
committed
fix(api-post): jsonpath异常无法操作
1 parent c6d2058 commit 74eb7a7

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

plugin-apipost/src/main/kotlin/me/leon/toolsfx/plugin/ApiPostView.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,8 @@ class ApiPostView : PluginFragment("ApiPost") {
454454
}
455455
val showdata =
456456
if (showJsonPath.get() && tfJsonPath.text.trim().isNotEmpty()) {
457-
resp.data.simpleJsonPath(tfJsonPath.text.trim())
457+
runCatching { resp.data.simpleJsonPath(tfJsonPath.text.trim()) }
458+
.getOrElse { resp.data }
458459
} else {
459460
resp.data
460461
}

plugin-apipost/src/main/kotlin/me/leon/toolsfx/plugin/PlaceHolders.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ fun String.methodCall(args: String): String {
3939
"base64" -> args.base64()
4040
"base64File" -> args.toFile().readBytes().base64()
4141
"binary" -> args.toBinaryString()
42+
"env" -> System.getenv(args)
4243
"uppercase" -> args.uppercase()
4344
"lowercase" -> args.lowercase()
4445
"date2Mills" ->

0 commit comments

Comments
 (0)