方法1:
// 获取接口重定向后的 url
const link = `https://add/thirdparty/embed`;
axios
.get(link)
.then(function (response) {
console.log(response.request.responseURL); // http://example.com/test
})
.catch(function (no200) {
console.error(no200);
});
方法2:
const link = 'https://add/thirdparty/embed'
const xhr = new XMLHttpRequest();
xhr.open('GET', link , true);
xhr.onload = function () {
console.log(xhr.responseURL); // http://example.com/test
}
xhr.send(null)