|
|
@ -8,10 +8,12 @@ class Otherloginstart extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
let query=this.props.location.search;
|
|
|
|
let query=this.props.location.search;
|
|
|
|
debugger
|
|
|
|
|
|
|
|
if(query!= ""){
|
|
|
|
if(query!= ""){
|
|
|
|
const type = query.split('?code=');
|
|
|
|
const type = query.split('?code=');
|
|
|
|
const types = type[1].split('&state=');
|
|
|
|
const types = type[1].split('&state=');
|
|
|
|
|
|
|
|
const typeshref = types[1].split(',');
|
|
|
|
|
|
|
|
|
|
|
|
let codeurl = `/auth/wechat/callback.json`
|
|
|
|
let codeurl = `/auth/wechat/callback.json`
|
|
|
|
axios.get(codeurl,{params:{
|
|
|
|
axios.get(codeurl,{params:{
|
|
|
|
code:types[0]
|
|
|
|
code:types[0]
|
|
|
@ -19,13 +21,13 @@ class Otherloginstart extends Component {
|
|
|
|
if(result){
|
|
|
|
if(result){
|
|
|
|
if(result.data.status===0){
|
|
|
|
if(result.data.status===0){
|
|
|
|
if(result.data.new_user===true){
|
|
|
|
if(result.data.new_user===true){
|
|
|
|
window.location.href="/otherlogin?type=wechat"
|
|
|
|
window.location.href=`https://${typeshref[1]}/otherlogin?type=wechat`;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
// this.getinfo()
|
|
|
|
// this.getinfo()
|
|
|
|
if(types[1]==="account"){
|
|
|
|
if(typeshref[1]==="account"){
|
|
|
|
window.location.href="/account/binding"
|
|
|
|
window.location.href=`https://${typeshref[1]}/account/binding`;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
window.location.href="/"
|
|
|
|
window.location.href=`https://${typeshref[1]}`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|