fix redirect
This commit is contained in:
parent
485f4bee29
commit
b797fdd1d8
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user