fix redirect to 404

master
timka 2023-11-22 22:50:56 +03:00
parent b797fdd1d8
commit adae20b9ab
1 changed files with 3 additions and 0 deletions

View File

@ -14,6 +14,9 @@ class Redirecter extends Component {
axios.get(`https://link.timka.su?link=${linkName}`).then( axios.get(`https://link.timka.su?link=${linkName}`).then(
function (response) { function (response) {
const json = response.data[0] const json = response.data[0]
if (json === undefined) {
window.location.href = '/404'
}
console.log(json) console.log(json)
window.location.href = json.url window.location.href = json.url
} }