解决前后端base64编码传递时的中文乱码问题

it2023-08-06  67

1 前端JavaScript加密

window.btoa(unescape(encodeURIComponent(str)))

2 后端Java解密

String decode = new String(Base64.getDecoder().decode(str), StandardCharsets.UTF_8);
最新回复(0)