使用encodeURIComponent()方法手动编码句点
代码示例:
const url = 'https://api.example.com/path/file.json'
const encodedUrl = url.replace(/\./g, '%2E') // 手动编码句点
axios.get(encodedUrl)
.then(response => {
console.log(response.data)
})
.catch(error => {
console.error(error)
})