第三方登录-educoder
This commit is contained in:
parent
6296434527
commit
c3e09f2672
|
@ -4,6 +4,7 @@ import Dialog from 'material-ui/Dialog';
|
||||||
import { notification } from 'antd';
|
import { notification } from 'antd';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import educoderLogo from './educoder.png';
|
||||||
|
|
||||||
import './LoginDialog.css';
|
import './LoginDialog.css';
|
||||||
import { broadcastChannelPostMessage } from 'educoder'
|
import { broadcastChannelPostMessage } from 'educoder'
|
||||||
|
@ -430,11 +431,6 @@ class LoginDialog extends Component {
|
||||||
getloginurl = (url) => {
|
getloginurl = (url) => {
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
};
|
};
|
||||||
openweixinlogin = () => {
|
|
||||||
this.setState({
|
|
||||||
weixinlogin: true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
openNotifications = (btn) => {
|
openNotifications = (btn) => {
|
||||||
// type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色
|
// type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色
|
||||||
notification.open({
|
notification.open({
|
||||||
|
@ -470,18 +466,17 @@ class LoginDialog extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let { qqlogin, login, isGoing, isGoingValue, disabled, bottonclass, Phonenumberisnotco,
|
let { login, isGoing, isGoingValue, disabled, Phonenumberisnotco,
|
||||||
dialogBox, isRender, weixinlogin } = this.state;
|
dialogBox, isRender, weixinlogin } = this.state;
|
||||||
|
|
||||||
let { settings } = this.props;
|
let { settings } = this.props;
|
||||||
if (isRender === undefined) {
|
if (isRender === undefined) {
|
||||||
isRender = false
|
isRender = false
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={true} id="DialogID"
|
<Dialog open={true} id="DialogID"
|
||||||
className="zindextest"
|
className="zindextest"
|
||||||
style={{ display: isRender == false ? 'none' : '' }}
|
style={{ display: isRender === false ? 'none' : '' }}
|
||||||
disableEscapeKeyDown={true}
|
disableEscapeKeyDown={true}
|
||||||
disableBackdropClick={true}
|
disableBackdropClick={true}
|
||||||
onClose={() => this.handleDialogClose()}
|
onClose={() => this.handleDialogClose()}
|
||||||
|
@ -512,7 +507,7 @@ class LoginDialog extends Component {
|
||||||
<li onClick={() => { this.enter(0) }}>登录</li>
|
<li onClick={() => { this.enter(0) }}>登录</li>
|
||||||
</ul>}
|
</ul>}
|
||||||
<div className="login-panel" id="login-panel-1" style={{ display: login == 0 ? 'block' : 'none' }}>
|
<div className="login-panel" id="login-panel-1" style={{ display: login == 0 ? 'block' : 'none' }}>
|
||||||
{weixinlogin === true ? "" : <form acceptCharset="UTF-8" action="/login" id="main_login_form" method="post">
|
<form acceptCharset="UTF-8" action="/login" id="main_login_form" method="post">
|
||||||
|
|
||||||
<div style={{ "display": "inline", "padding": "0", "margin": "0" }}>
|
<div style={{ "display": "inline", "padding": "0", "margin": "0" }}>
|
||||||
<input name="utf8" type="hidden" value="✓"></input>
|
<input name="utf8" type="hidden" value="✓"></input>
|
||||||
|
@ -581,28 +576,25 @@ class LoginDialog extends Component {
|
||||||
<a onClick={(url) => this.getloginurl(`${settings && settings.common && settings.common.register}`)} className="color-grey-9">注册</a>
|
<a onClick={(url) => this.getloginurl(`${settings && settings.common && settings.common.register}`)} className="color-grey-9">注册</a>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
{
|
||||||
{this.props.user && this.props.user.main_site === true ? this.state.isphone === true ? <p className="clearfix mt20">
|
settings && settings.third_party && settings.third_party.length > 0 ?
|
||||||
|
<p className="clearfix mt20">
|
||||||
<span className={"startlogin"}>———————— 快速登录 ————————</span>
|
<span className={"startlogin"}>———————— 快速登录 ————————</span>
|
||||||
<div className={"mt10"}>
|
<div className={"mt10"}>
|
||||||
<a onClick={() => this.openweixinlogin()}>
|
{settings.third_party.map((item,key)=>{
|
||||||
<img src={require('./WeChat.png')} alt="微信登录" />
|
return(
|
||||||
</a>
|
<a href={`${item.url}`}>
|
||||||
<a onClick={() => this.openqqlogin()} className={"ml10"}>
|
<img src={item.name === "educoder" ? educoderLogo : ""} width="46px" alt={`${item.name}登录`} />
|
||||||
<img src={require('./qq.png')} alt="qq登录" />
|
|
||||||
</a>
|
</a>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</p> : <p className="clearfix mt20">
|
</p>
|
||||||
|
:""
|
||||||
<span className={"startlogin"}>———————— 快速登录 ————————</span>
|
}
|
||||||
<div className={"mt10"}>
|
</form>
|
||||||
<a onClick={() => this.openphoneqqlogin()} className={"ml10"}>
|
{/* {weixinlogin === true ? <iframe
|
||||||
<img src={require('./qq.png')} alt="qq登录" />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</p> : ""}
|
|
||||||
</form>}
|
|
||||||
{weixinlogin === true ? <iframe
|
|
||||||
className={"weixinheight390"}
|
className={"weixinheight390"}
|
||||||
frameBorder="0"
|
frameBorder="0"
|
||||||
sandbox="allow-scripts allow-same-origin allow-top-navigation"
|
sandbox="allow-scripts allow-same-origin allow-top-navigation"
|
||||||
|
@ -610,7 +602,7 @@ class LoginDialog extends Component {
|
||||||
src={`https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&response_type=code&scope=snsapi_login&state=null,${window.location.host}#wechat_redirect`}></iframe> : ""}
|
src={`https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&response_type=code&scope=snsapi_login&state=null,${window.location.host}#wechat_redirect`}></iframe> : ""}
|
||||||
{weixinlogin === true ? <p className="clearfix ">
|
{weixinlogin === true ? <p className="clearfix ">
|
||||||
<a className={"startlogin color-blue"} onClick={() => this.hideweixinlogin()}>返回账号登录</a>
|
<a className={"startlogin color-blue"} onClick={() => this.hideweixinlogin()}>返回账号登录</a>
|
||||||
</p> : ""}
|
</p> : ""} */}
|
||||||
</div>
|
</div>
|
||||||
{/*快捷登录*/}
|
{/*快捷登录*/}
|
||||||
</div>
|
</div>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Loading…
Reference in New Issue