fix redirect

master
timka 2023-11-22 22:50:14 +03:00
parent 485f4bee29
commit b797fdd1d8
1 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,8 @@ import {React, Component} from "react";
import {resolve} from "crypto-browserify/example/bundle"; import {resolve} from "crypto-browserify/example/bundle";
import "../config" import "../config"
const axios = require('axios').default import 'axios'
import axios from "axios";
class Redirecter extends Component { class Redirecter extends Component {
@ -12,10 +13,9 @@ class Redirecter extends Component {
console.log(linkName) console.log(linkName)
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.toString() const json = response.data[0]
const obj = JSON.parse(json) console.log(json)
console.log(obj) window.location.href = json.url
window.location.href = obj.url
} }
) )
return return