npm install --save base-64

在react中中引入依赖

import Base64  from 'base-64';

使用

Base64.encode(this.pwd);//加密
Base64.decode(this.pwd);//解密

  

相关文章: