url传递参数 加码和解码 encodeURI decodeURI
转载
url传递参数 url的加码和解码 encodeURI decodeURI
加码 encodeURI
const sendData = {
boxId: this.state.boxIdMessage[0].boxId,
flag: "add",
from: 'boxMessage'
}
let jsonsendDataTemp = JSON.stringify(sendData)
let jsonsendData = encodeURI(jsonsendDataTemp)
// 【3首=》扫=》盒=》编(从盒子到编辑) 3.盒子页创建编辑页(添加)】
if (_openw) { return } // 防止快速点击
_openw = createWebview('http://cncwww.cn:9000/#/edictor?sendData=' + jsonsendData, 'edictor_box_add','添加数据')
解码 decodeURI
// 获取路由传过来的值
let querytemp = this.props.location.search
let query = decodeURI(querytemp)
let reciveDataTemp = query.substring(query.indexOf('=') + 1, query.length)
let reciveData = JSON.parse(reciveDataTemp)
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。