1.问题是接口传递的时候鞋携带的参数太长了
2.如encodeURIComponent()方法相当于加密让其,忽略传参数的长度
例如:
url:'../Consulting/Consulting?opend='+encodeURIComponent(JSON.stringify(item))
3.decodeURIComponent()方法相当于解密
onLoad(opend){
this.Coninglist = JSON.parse(decodeURIComponent(opend.opend))
console.log(this.Coninglist.cover)
console.log(this.uyt=this.fileUrl+this.Coninglist.cover)
},
本文介绍了在接口参数过长时,如何使用encodeURIComponent方法进行URL编码,以解决长度限制问题。通过encodeURIComponent将JSON对象转换为编码字符串传递,然后在接收端用decodeURIComponent解码并解析为原始数据。这种方法在前端开发中常用于处理复杂参数的传递。
7136

被折叠的 条评论
为什么被折叠?



