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

const publicKey = `MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwHkUfT2GAupZAL5DMnwETSywuPLIKUAR3hjhKvOls2u0YtIHlcfjhqGBfg0NEPi6Ig2GmK5KnjcdIppfNfBpSiJBEtMwM2E7WJbXBsYU0B4wB86XGW9fFQi0e8pGYvVbKvwP9MQeLnUC4xf2L+6Nw3xQZ9GAsE6GUJ4tUOSKK/QIDAQAB`
export const encryption = (str) => {
    //创建实例
    const jse = new JSEncrypt()
    //添加秘钥 秘钥放过来
    jse.setPublicKey(publicKey)
    //加密
    let data = jse.encrypt(str)
    return data

}
