let url = 'http%3A%2F%2Fnmdm-t%2Fzgh'
url = decodeURIComponent(url)
console.log(url)
// http://nmdm-t/zgh
let url = 'http://nmdm-t/zgh'
url = encodeURIComponent(url)
console.log(url)
// 'http%3A%2F%2Fnmdm-t%2Fzgh'
以上如果都不行,可以试一下用代码操作:
URL = strURL.replaceAll("%3A", ":").replaceAll("%2F", "/") //过滤URL 包含中文
.replaceAll("%3F", "?").replaceAll("%3D", "=").replaceAll(
"%26", "&");