import JSEncrypt from 'jsencrypt/bin/jsencrypt.min'
// 密钥对生成 http://web.chacuo.net/netrsakeypair
const publicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuV25rGdxcvQTOurqf66AgTUsDR4ohE34tPhB2B8NVkFoYD4+LtC0Efknz7AvAXX0OkyYp6PgsrapBS3X+T76KK+FTCMrUf01SJvJIm16bno6nInK5LeA+ujtghzC8yQ8w7DuP3xf8m5+UoZ21xLmq/9qHCIzQCKfZKnmyV6H57br+P9MJmVq8G8Tynu7Q26DC9UWAhSWmpsygga5jO2uY3uvAvu2BPnze/xDECEf3Uqs3Mf0Pqg8g7NtpPsGmT4y/14hg0k8Z1AY+QPjzXqN3ikA61ZEGuoGcZ33tTAZ/I27vJI40oOTY9yw2DlxrpNW8naREeo5F/ANagsNtDjuBwIDAQAB'
// 加密
export function encrypt(txt) {
  const encryptor = new JSEncrypt()
  encryptor.setPublicKey(publicKey) // 设置公钥
  return encryptor.encrypt(txt) // 对数据进行加密
}
