mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 17:37:40 +08:00
优化:webhook发送通道的 webParams 新增可用标签
This commit is contained in:
parent
c357517f6f
commit
bf5547d84b
@ -8,6 +8,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.idormy.sms.forwarder.model.vo.SmsVo;
|
import com.idormy.sms.forwarder.model.vo.SmsVo;
|
||||||
import com.idormy.sms.forwarder.utils.CertUtils;
|
import com.idormy.sms.forwarder.utils.CertUtils;
|
||||||
import com.idormy.sms.forwarder.utils.Define;
|
import com.idormy.sms.forwarder.utils.Define;
|
||||||
@ -178,15 +179,10 @@ public class SenderWebNotifyMsg extends SenderBaseMsg {
|
|||||||
|
|
||||||
//JSON需要转义的字符
|
//JSON需要转义的字符
|
||||||
private static String escapeJson(String str) {
|
private static String escapeJson(String str) {
|
||||||
return str.replace("\n", "\\n")
|
if (str == null) return "null";
|
||||||
.replace("\"", "\\\"")
|
|
||||||
.replace("\\/", "\\\\/")
|
String jsonStr = JSON.toJSONString(str);
|
||||||
.replace("\\b", "\\\\b")
|
return jsonStr.length() >= 2 ? jsonStr.substring(1, jsonStr.length() - 1) : jsonStr;
|
||||||
.replace("\\f", "\\\\f")
|
|
||||||
.replace("\\t", "\\\\t")
|
|
||||||
.replace("\\n", "\\\\n")
|
|
||||||
.replace("\\r", "\\\\r")
|
|
||||||
.replace("\\u", "\\\\u");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user