mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-02 17:07:41 +08: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)
|
else -> XHttp.post(requestUrl).keepJson(true)
|
||||||
}
|
}
|
||||||
webParams.trim('&').split("&").forEach {
|
webParams.trim('&').split("&").forEach {
|
||||||
val param = it.split("=")
|
val sepIndex = it.indexOf("=")
|
||||||
if (param.size == 2) {
|
if (sepIndex != -1) {
|
||||||
postRequest.params(
|
val key = it.substring(0, sepIndex).trim()
|
||||||
param[0], param[1].replace("[from]", from)
|
val value = it.substring(sepIndex + 1).trim()
|
||||||
.replace("[content]", content)
|
postRequest.params(key, value.replace("[from]", from)
|
||||||
.replace("[msg]", content)
|
.replace("[content]", content)
|
||||||
.replace("[org_content]", orgContent)
|
.replace("[msg]", content)
|
||||||
.replace("[device_mark]", deviceMark)
|
.replace("[org_content]", orgContent)
|
||||||
.replace("[app_version]", appVersion)
|
.replace("[device_mark]", deviceMark)
|
||||||
.replace("[title]", simInfo)
|
.replace("[app_version]", appVersion)
|
||||||
.replace("[card_slot]", simInfo)
|
.replace("[title]", simInfo)
|
||||||
.replace(receiveTimeTag) { t ->
|
.replace("[card_slot]", simInfo)
|
||||||
val format = t.groups[2]?.value
|
.replace(receiveTimeTag) { t ->
|
||||||
formatDateTime(msgInfo.date, format)
|
val format = t.groups[2]?.value
|
||||||
}
|
formatDateTime(msgInfo.date, format)
|
||||||
.replace("[timestamp]", timestamp.toString())
|
}
|
||||||
.replace("[sign]", sign)
|
.replace("[timestamp]", timestamp.toString())
|
||||||
|
.replace("[sign]", sign)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user