// js 对url进行编码和解码 // 编码: encodeURIComponent() // 解码:decodeURIComponent() const url = ` country=CN& province=%E9%9D%92%E6%B5%B7%E7%9C%81 &provinceCode=630000 &city=%E6%B5%B7%E8%A5%BF%E8%92%99%E5%8F%A4%E6%97%8F%E8%97%8F%E6%97%8F%E8%87%AA%E6%B2%BB%E5%B7%9E &cityCode=632800 ` const str = '测试数据9527' console.log(decodeURIComponent(url)) console.log(encodeURIComponent(str))