记录一下问题:
使用 encodeURI(str) 对字符串进行加密的时候,后端解密会丢失+
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<script>
function encodeBase64(str){
// 对字符串进行编码
// var encode = encodeURIComponent(str);
var encode = encodeURI(str);
// 对编码的字符串转化base64
var base64 = btoa(encode);
console.log(base64);
}
</script>
<body>
<input type="button" name="" id="" onclick="encodeBase64('111测试风吹是+===')">点击
</body>
</html>
public class