This commit is contained in:
suyl
2021-08-17 11:50:58 +08:00
parent bdba0e5da8
commit 4424ee07e5

View File

@@ -103,7 +103,7 @@ func (a *API) Encrypt(msg string) (encryptedMsg string, err error) {
binary.Write(buf, binary.BigEndian, int32(len(msg)))
buf.WriteString(msg)
buf.WriteString(a.corpID)
binResult, err := utils.AESCBCEncpryt(buf.Bytes(), aesKey, []byte(a.corpID[:16]))
binResult, err := utils.AESCBCEncpryt(buf.Bytes(), aesKey, aesKey[:16])
encryptedMsg = base64.StdEncoding.EncodeToString(binResult)
return encryptedMsg, err
}
@@ -211,6 +211,7 @@ func (a *API) GetCallbackMsg(formMap map[string]interface{}, bodyData []byte) (m
err = utils.UnmarshalUseNumber([]byte(descryptMsg), &msgMap)
}
}
return msgMap, a.Err2CallbackResponse(err)
}
return nil, a.Err2CallbackResponse(err)
}