This commit is contained in:
suyl
2021-08-17 11:32:51 +08:00
parent 5d45db20f4
commit bdba0e5da8

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, aesKey[:16])
binResult, err := utils.AESCBCEncpryt(buf.Bytes(), aesKey, []byte(a.corpID[:16]))
encryptedMsg = base64.StdEncoding.EncodeToString(binResult)
return encryptedMsg, err
}