parent
315f58a7fb
commit
a03bb0dafb
@ -0,0 +1,52 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
|
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
|
||||||
|
|
||||||
|
import { Spin } from 'antd';
|
||||||
|
import axios from 'axios';
|
||||||
|
class Otherloginstart extends Component {
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
let query=this.props.location.search;
|
||||||
|
const type = query.split('?code=');
|
||||||
|
const types = type[1].split('&state=');
|
||||||
|
let codeurl = `/auth/wechat/callback.json`
|
||||||
|
axios.get(codeurl,{params:{
|
||||||
|
code:types[0]
|
||||||
|
}}).then((result)=> {
|
||||||
|
if(result){
|
||||||
|
if(result.data.status===0){
|
||||||
|
if(result.data.true===false){
|
||||||
|
window.location.href="/otherlogin"
|
||||||
|
}else{
|
||||||
|
// this.getinfo()
|
||||||
|
window.location.href="/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).catch((error)=>{
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
// Loading
|
||||||
|
return (
|
||||||
|
<div className="App" style={{minHeight: '800px',width:"100%"}}>
|
||||||
|
<style>
|
||||||
|
{
|
||||||
|
`
|
||||||
|
.margintop{
|
||||||
|
margin-top:20%;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<Spin size="large" className={"margintop"}/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Otherloginstart;
|
Loading…
Reference in new issue