Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
smile-vi opened this issue Dec 7, 2021 · 2 comments
Open

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

smile-vi opened this issue Dec 7, 2021 · 2 comments

Comments

@smile-vi
Copy link

smile-vi commented Dec 7, 2021

No description provided.

@yinjihuan
Copy link
Owner

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

@ChannD
Copy link

ChannD commented Feb 5, 2024

我这边也是这样的问题
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())
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants