Skip to content

Commit efb227b

Browse files
committed
feat(apipost): 支持urlencode函数
1 parent 4362a92 commit efb227b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import me.leon.encode.base.base64
77
import me.leon.ext.toBinaryString
88
import me.leon.ext.toFile
99
import me.leon.hash
10+
import tornadofx.urlEncoded
1011

1112
const val TIMESTAMP = "{{timestamp}}"
1213
const val TIMESTAMP_SECONDS = "{{timestamp2}}"
@@ -36,6 +37,7 @@ fun String.methodCall(args: String): String {
3637
return when (this) {
3738
"md5" -> args.hash(this)
3839
"digest" -> args.substringAfter(",").hash(args.substringBefore(","))
40+
"urlencode" -> args.urlEncoded
3941
"base64" -> args.base64()
4042
"base64File" -> args.toFile().readBytes().base64()
4143
"binary" -> args.toBinaryString()

0 commit comments

Comments
 (0)