
import JSEncrypt from "jsencrypt"; //引入模块

const publicKey = `MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA05Wt7Jqv+fQFS4ND2sqY
XAMnn7iZYCThxe5zfXjqZ27Q3bIC0NIIgKAcrox3Ke5mb+hJ4D5pYFbnRdaRC6X1
64QDMLMxNd2jgVrSVwJbEIJaBNeLIzcS6ZzozVEMgIquOBfurwt8il070eFczoBL
iFXnfLlmTpx0fSem4pTBLIRPuM0fQQAeD419Pu/p067EuYBMOy19c6pf0QQnUVbd
PZjDvZb8WLXXtpKhAWT/9o6CjJkieTmkjslP479fk/ImRXbmALwoByVpY+kX6NTX
6gBEy53svi7arlC1IK+Pp9nX/RbUkLRoXH2he6dgd5F/8QCV4eHMJ6CeLuUORVx2
FQIDAQAB`
export const encryption = (str) => {
    //创建实例
    const jse = new JSEncrypt()
    //添加秘钥 秘钥放过来
    jse.setPublicKey(publicKey)
    //加密
    let data = jse.encrypt(str)
    return data

}
