# 原生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 : "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAIaUJLEWByQnYSZMeQ2sdHR7SOWpcz8MKjA0yAfVcwSRzkobuPhbbTj6ot6x3TKki+pKBwq5BmKsyPKFHVdV9bHtsAxeMGHqh1zZs6c2gwEcxFUHKfr0buY9K6ahrSckffMDPH/HgTV9nb62Jq633IZyDSe4ur1wSKMNitwr/bcRAgMBAAECgYBd3dBlz9Z1Sh5Bx08b0XB8mkzzGyiuDf8TFo16oU+THVvEZueyGprpBjA5odeF7i1E4hNdUEZ65sdWGLCpbORsDgbi1rjmbG7oGXK4H7GB+E5VTlX732zwTnLABywrfAU3LRLEWuBTARU6J6WwvNINFq3HzXXPCiXQDNB0+A4+HQJBAMJyyg8w6j6yrZPYZUnPkrwCpdA2Np0h9mhB2nKaQThEUErDLaa48SVd6ueUaqI/2PRoibSEgaDqs0SoF8361P8CQQCxLckt/weiH5qWrrhMSmcxlStD8vnjyDbjLsq4/PxVocpyv8yqt2Yz1Y7zX1m9Al1eCmsuJOzzdO5JMC1STiPvAkBr8gmWEVOY5txRfQoNxbvxv46JXe9Hn/kIu7YndNbMA7CHMH8BVR4Z3l9vnAbud39bf0Ui/4Ru7pwCe0ZrxNnFAkEAiTUr1rLo9mQDEy27C1mTEJK0Lqq7WepylvxlgVxpDOd+H97oYEwmmX2IdnAgzn5GT81BszplRSQIZCUq89IPgQJBALqXh6wStKW/hNuGIPBlw+V6YZnFkAfoBB2rAhbdnY0n8OafrG3OLlDOKtLL78J+Oho/Yv2/YLhQ77C7haIwfZE=",
	                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: {
	
		}
	}

	