# 原生js   小程序    mark-jsencrypt.js

# 兼容原生app清使用 mark-jsencrypt-app.js

	
	import JSEncrypt from "@/js-sdk/mark-jsencrypt.js"	
	
	export default {
			data() {
				return {
					 PUBLIC_KEY : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCGlCSxFgckJ2EmTHkNrHR0e0jlqXM/DCowNMgH1XMEkc5KG7j4W204+qLesd0ypIvqSgcKuQZirMjyhR1XVfWx7bAMXjBh6odc2bOnNoMBHMRVByn69G7mPSumoa0nJH3zAzx/x4E1fZ2+tiaut9yGcg0nuLq9cEijDYrcK/23EQIDAQAB",
					 PRIVATE_KEY : " ",
	                long_text:{"name":"中文","age":18,"text":"长长的中文长长的中文长长的中文长长的中文长长的中文长长的中文长长的中文长长的中文长长的中文长长的中文长长的中文长长的中文长长的中文"},
	data:"",
				dataEn:"",
				dataDn:"",
				data1:"",
			}
		},
		onLoad() {
		
		var encrypt = new JSEncrypt();
			encrypt.setPublicKey(this.PUBLIC_KEY);
			
			this.data = encodeURIComponent(JSON.stringify(this.long_text));
			this.dataEn = encrypt.encryptLong(this.data);
			console.log('encodeURIComponent:%o', this.data);
			console.log('encryptLong后数据:%o', this.dataEn);
			
					var decrypt = new JSEncrypt();
			decrypt.setPrivateKey(this.PRIVATE_KEY);
			this.dataDn = decrypt.decryptLong(this.dataEn);
			this.data1 =decodeURIComponent(this.dataDn)
			
			console.log('decryptLong后数据:%o', this.dataDn);
			console.log('decodeURIComponent后数据:%o', this.data1);
			
				},
		methods: {
	
		}
	}

	