// 导入包
import WxmpRsa from 'wxmp-rsa'

const publicKey =
	'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMOcPB06u5yKyQsPjfVWiWgbEIrd14kiXNNihciaVKb6HnkQvq7zpQuZ80WEX94spnUMI3iOAl/GmIvHrpGwcbB4hJbznm+PajiwnUSPuCCXA68YJF640cJKb/8KeM7WVz69OFkIEPHhVxOy4FFF5QWe/kt6zOZ19HmE+ak+5x/QIDAQAB'

// 加密方法
export function RSAencrypt(pas) {
	// 实例化rsa
	const rsa = new WxmpRsa()
	// 设置公钥
	rsa.setPublicKey(publicKey)
	// 加密后的密码
	const res = rsa.encryptLong(pas)
	// console.log('加密：' + res)
	return res
}