yinjihuan / monkey-api-encrypt

monkey-api-encrypt是对基于Servlet的Web框架API请求进行统一加解密操作
Apache License 2.0
793 stars 346 forks source link

版本1.2.2,前端解密出现异常Malformed UTF-8 data #78

Open smile-vi opened 2 years ago

yinjihuan commented 2 years ago

有具体的吗,这个没有详细信息啊

ChannD commented 9 months ago

我这边也是这样的问题 js export function decrypt(data) { console.log('data first::', data) data = data.toString().replace(/[\r\n|\r|\n|\n\r]/g, '') console.log('data second::', data) let decrypt = CryptoJS.AES.decrypt(data, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7, }) decrypt = decrypt.toString().replace(/[\r\n|\r|\n|\n\r]/g, '') console.log('decrypt::', decrypt) return JSON.parse(CryptoJS.enc.Utf8.stringify(decrypt).toString()) }