mirror of
https://github.com/pppscn/SmsForwarder
synced 2024-11-08 01:10:23 +00:00
优化:webhook
通道webParam
分割键值对方式 #472
This commit is contained in:
parent
8cc4c76735
commit
f7d2544ee9
@ -161,23 +161,24 @@ class WebhookUtils {
|
||||
else -> XHttp.post(requestUrl).keepJson(true)
|
||||
}
|
||||
webParams.trim('&').split("&").forEach {
|
||||
val param = it.split("=")
|
||||
if (param.size == 2) {
|
||||
postRequest.params(
|
||||
param[0], param[1].replace("[from]", from)
|
||||
.replace("[content]", content)
|
||||
.replace("[msg]", content)
|
||||
.replace("[org_content]", orgContent)
|
||||
.replace("[device_mark]", deviceMark)
|
||||
.replace("[app_version]", appVersion)
|
||||
.replace("[title]", simInfo)
|
||||
.replace("[card_slot]", simInfo)
|
||||
.replace(receiveTimeTag) { t ->
|
||||
val format = t.groups[2]?.value
|
||||
formatDateTime(msgInfo.date, format)
|
||||
}
|
||||
.replace("[timestamp]", timestamp.toString())
|
||||
.replace("[sign]", sign)
|
||||
val sepIndex = it.indexOf("=")
|
||||
if (sepIndex != -1) {
|
||||
val key = it.substring(0, sepIndex).trim()
|
||||
val value = it.substring(sepIndex + 1).trim()
|
||||
postRequest.params(key, value.replace("[from]", from)
|
||||
.replace("[content]", content)
|
||||
.replace("[msg]", content)
|
||||
.replace("[org_content]", orgContent)
|
||||
.replace("[device_mark]", deviceMark)
|
||||
.replace("[app_version]", appVersion)
|
||||
.replace("[title]", simInfo)
|
||||
.replace("[card_slot]", simInfo)
|
||||
.replace(receiveTimeTag) { t ->
|
||||
val format = t.groups[2]?.value
|
||||
formatDateTime(msgInfo.date, format)
|
||||
}
|
||||
.replace("[timestamp]", timestamp.toString())
|
||||
.replace("[sign]", sign)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user