问题:修改ip的接口成功后需要跳转修改后的ip地址
失败的代码:
this.$axios.get(url).then(res=>{
let path=res.ip+window.location.pathname
window.location.href=path
})
原因:没有加协议
更正:
his.$axios.get(url).then(res=>{
let path=window.location.protocol+'//'+res.ip+window.location.pathname
window.location.href=path
})