qq登录流程恢复

sso
杨树明 5 years ago
parent 6bbbec3956
commit ad99a3c594

@ -66,12 +66,19 @@ const EducoderLogin = Loadable({
loading: Loading, loading: Loading,
}) })
//微信登录 //微信登录
const Otherlogin=Loadable({ const Otherlogin=Loadable({
loader: () => import('./modules/login/Otherlogin'), loader: () => import('./modules/login/Otherlogin'),
loading: Loading, loading: Loading,
}) })
//微信登录
const Loginqq=Loadable({
loader: () => import('./modules/login/Loginqq'),
loading: Loading,
})
const Otherloginstart=Loadable({ const Otherloginstart=Loadable({
loader: () => import('./modules/login/Otherloginstart'), loader: () => import('./modules/login/Otherloginstart'),
@ -632,6 +639,10 @@ class App extends Component {
<Route <Route
path="/otherlogin" component={Otherlogin} path="/otherlogin" component={Otherlogin}
/> />
<Route
path="/loginqq" component={Loginqq}
/>
<Route path="/users/:username" <Route path="/users/:username"
render={ render={
(props) => { (props) => {

@ -50,7 +50,7 @@ var newContainer={
paddingTop: "40px", paddingTop: "40px",
} }
class Otherlogin extends Component { class Loginqq extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state={ this.state={
@ -289,4 +289,4 @@ class Otherlogin extends Component {
} }
export default Otherlogin; export default Loginqq;

@ -47,3 +47,8 @@
width: 100%; width: 100%;
margin-top: 25px; margin-top: 25px;
} }
.weixinmarauto{
width: 24%;
margin: 0 auto;
}

@ -244,7 +244,7 @@ class Otherlogin extends Component {
placeholder="输入密码,注意区分大小写" placeholder="输入密码,注意区分大小写"
></Input.Password> ></Input.Password>
</Content> </Content>
{this.state.logintypes==="username"?<span className={"color-red ml50"}>请填写账号</span>:this.state.logintypes==="password"?<span className={"color-red ml50"}></span>:""} {this.state.logintypes==="username"?<span className={"color-red ml50 weixinmarauto"}>请填写账号</span>:this.state.logintypes==="password"?<span className={"color-red ml50 weixinmarauto"}></span>:""}
<Footer className={"weixinfooter mt30"}> <Footer className={"weixinfooter mt30"}>
<Button className="login_btn font-16 wechattiyan" type="primary" style={{height:"46px"}} onClick={() => this.postwechatlogin(false,this.state.login,this.state.password)} <Button className="login_btn font-16 wechattiyan" type="primary" style={{height:"46px"}} onClick={() => this.postwechatlogin(false,this.state.login,this.state.password)}
size={"large"}>绑定</Button> size={"large"}>绑定</Button>

@ -12,12 +12,6 @@ class Otherloginqq extends Component {
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('%2C'); const typeshref = types[1].split('%2C');
if(decodeURIComponent(typeshref[1])==="test-newweb.educoder.net"){
window.location.href=`https://${decodeURIComponent(typeshref[1])}/otherloginqq?code=${types[0]}&state=null%2C`;
}else if(decodeURIComponent(typeshref[1])==="pre-newweb.educoder.net"){
window.location.href=`https://${decodeURIComponent(typeshref[1])}/otherloginqq?code=${types[0]}&state=null%2C`;
}
let codeurl = `/auth/qq/callback`; let codeurl = `/auth/qq/callback`;
axios.get(codeurl,{params:{ axios.get(codeurl,{params:{
code:types[0], code:types[0],
@ -26,13 +20,13 @@ class Otherloginqq 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){
this.props.history.replace(`/otherlogin?type=qq`); window.location.href=`https://${decodeURIComponent(typeshref[1])}/loginqq?type=qq`;
}else{ }else{
// this.getinfo() // this.getinfo()
if(typeshref[0]==="account"){ if(typeshref[0]==="account"){
this.props.history.replace(`/account/binding`); window.location.href=`https://${decodeURIComponent(typeshref[1])}/account/binding`;
}else{ }else{
this.props.history.replace(`/`); window.location.href=`https://${decodeURIComponent(typeshref[1])}`;
} }
} }
} }

@ -168,11 +168,7 @@ class sendPanel extends Component{
let{sentShixunPath,sendToCourseList,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state; let{sentShixunPath,sendToCourseList,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state;
return( return(
<div> <div>
<style>{`
body{
overflow:hidden!important;
}
`}</style>
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
@ -201,6 +197,11 @@ class sendPanel extends Component{
destroyOnClose={true} destroyOnClose={true}
> >
<div className="newupload_conbox"> <div className="newupload_conbox">
<style>{`
body{
overflow:hidden!important;
}
`}</style>
<div className="mb20" <div className="mb20"
// onMouseLeave={this.closeList} // onMouseLeave={this.closeList}
> >

Loading…
Cancel
Save