修复:钉钉群机器人不填写加签密钥时报错(Empty key)

This commit is contained in:
pppscn 2022-06-17 09:33:14 +08:00
parent 8c62603ae7
commit 4b246705d1
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ class DingtalkUtils private constructor() {
var requestUrl = if (setting.token.startsWith("http")) setting.token else "https://oapi.dingtalk.com/robot/send?access_token=" + setting.token var requestUrl = if (setting.token.startsWith("http")) setting.token else "https://oapi.dingtalk.com/robot/send?access_token=" + setting.token
if (setting.secret != null) { if (!TextUtils.isEmpty(setting.secret)) {
val timestamp = System.currentTimeMillis() val timestamp = System.currentTimeMillis()
val stringToSign = "$timestamp\n" + setting.secret val stringToSign = "$timestamp\n" + setting.secret
val mac = Mac.getInstance("HmacSHA256") val mac = Mac.getInstance("HmacSHA256")