地址栏传参过程中,遇到中文要编码、解码
编码
let openUrl = '?id=' + id + '&month=' + month + '&rc=' + rc + '&pc=' + pc + '&nf=' + nf + '&cbts=' + encodeURI(encodeURI(cbts)) + '&MonRrSea=' + MonRrSea + '&cbtsMc=' + encodeURI(encodeURI(cbtsMc)) + '&cbtsORcbr=' + this.cbtsORcbr + '&cbrMc=' + encodeURI(encodeURI(cbrMc)) + '&cbr=' + cbr + '&cbtstype=' + type + '&cbtstype=' + cbtstype
解码
this.lastParams.cbts = decodeURI(this.lastParams.cbts)
this.lastParams.cbtsMc = decodeURI(decodeURI(this.lastParams.cbtsMc))
this.lastParams.cbrMc = decodeURI(decodeURI(this.lastParams.cbrMc))
编码几次就要解码几次
网友评论