1.当字符串过长时,需要用 encryptlong 来加密,否则会报参数过长的问题
2.当这个加密的值运用在url的参数加密中,如果url是另一个项目的话,会出现解密后值为空的现象
3.此时需要在加密后 再次用url加密
具体如下
加密
let query = {
id:this.id,
type:1,
ids:ids.join(',')
}
this.h5Url2 = `${process.env.VUE_APP_H5_BASE_HTTP}/shareId=${encodeURIComponent(this.$encryptLong(JSON.stringify(query)))}`;
解密
this.$decryptLong(decodeURIComponent(this.$route.query.shareId)