使用crypto-js对数据进行加密 解密
1. Base64 加密 解密
import Base64 from 'crypto-js/enc-base64'
import Utf8 from 'crypto-js/enc-utf8'
import CryptoJS from 'crypto-js'
let enKey = Base64.stringify(Utf8.parse('Dearenke'))
console.log('Base64加密',enKey);
let encodeKey = CryptoJS.enc.Base64.parse(enKey)
console.log('Base64解密',CryptoJS.enc.Utf8.stringify(encodeKey));
Base64加密 RGVhcmVua2U=
index.js:37 Base64解密 Dearenke