mirror of
https://github.com/pppscn/SmsForwarder
synced 2024-11-04 06:00:11 +00: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 com.alibaba.fastjson.JSON;
|
||||
import com.idormy.sms.forwarder.model.vo.SmsVo;
|
||||
import com.idormy.sms.forwarder.utils.CertUtils;
|
||||
import com.idormy.sms.forwarder.utils.Define;
|
||||
@ -178,15 +179,10 @@ public class SenderWebNotifyMsg extends SenderBaseMsg {
|
||||
|
||||
//JSON需要转义的字符
|
||||
private static String escapeJson(String str) {
|
||||
return str.replace("\n", "\\n")
|
||||
.replace("\"", "\\\"")
|
||||
.replace("\\/", "\\\\/")
|
||||
.replace("\\b", "\\\\b")
|
||||
.replace("\\f", "\\\\f")
|
||||
.replace("\\t", "\\\\t")
|
||||
.replace("\\n", "\\\\n")
|
||||
.replace("\\r", "\\\\r")
|
||||
.replace("\\u", "\\\\u");
|
||||
if (str == null) return "null";
|
||||
|
||||
String jsonStr = JSON.toJSONString(str);
|
||||
return jsonStr.length() >= 2 ? jsonStr.substring(1, jsonStr.length() - 1) : jsonStr;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user