第三方登录-educoder

This commit is contained in:
caishi 2021-04-01 15:35:45 +08:00
parent 6296434527
commit c3e09f2672
2 changed files with 21 additions and 29 deletions

View File

@ -4,6 +4,7 @@ import Dialog from 'material-ui/Dialog';
import { notification } from 'antd';
import axios from 'axios';
import educoderLogo from './educoder.png';
import './LoginDialog.css';
import { broadcastChannelPostMessage } from 'educoder'
@ -430,11 +431,6 @@ class LoginDialog extends Component {
getloginurl = (url) => {
window.location.href = url;
};
openweixinlogin = () => {
this.setState({
weixinlogin: true
})
}
openNotifications = (btn) => {
// type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色
notification.open({
@ -470,18 +466,17 @@ class LoginDialog extends Component {
}
render() {
let { qqlogin, login, isGoing, isGoingValue, disabled, bottonclass, Phonenumberisnotco,
let { login, isGoing, isGoingValue, disabled, Phonenumberisnotco,
dialogBox, isRender, weixinlogin } = this.state;
let { settings } = this.props;
if (isRender === undefined) {
isRender = false
}
return (
<Dialog open={true} id="DialogID"
className="zindextest"
style={{ display: isRender == false ? 'none' : '' }}
style={{ display: isRender === false ? 'none' : '' }}
disableEscapeKeyDown={true}
disableBackdropClick={true}
onClose={() => this.handleDialogClose()}
@ -512,7 +507,7 @@ class LoginDialog extends Component {
<li onClick={() => { this.enter(0) }}>登录</li>
</ul>}
<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" }}>
<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>
</span>
</p>
{this.props.user && this.props.user.main_site === true ? this.state.isphone === true ? <p className="clearfix mt20">
<span className={"startlogin"}> 快速登录 </span>
<div className={"mt10"}>
<a onClick={() => this.openweixinlogin()}>
<img src={require('./WeChat.png')} alt="微信登录" />
</a>
<a onClick={() => this.openqqlogin()} className={"ml10"}>
<img src={require('./qq.png')} alt="qq登录" />
</a>
</div>
</p> : <p className="clearfix mt20">
{
settings && settings.third_party && settings.third_party.length > 0 ?
<p className="clearfix mt20">
<span className={"startlogin"}> 快速登录 </span>
<div className={"mt10"}>
<a onClick={() => this.openphoneqqlogin()} className={"ml10"}>
<img src={require('./qq.png')} alt="qq登录" />
</a>
{settings.third_party.map((item,key)=>{
return(
<a href={`${item.url}`}>
<img src={item.name === "educoder" ? educoderLogo : ""} width="46px" alt={`${item.name}登录`} />
</a>
)
})
}
</div>
</p> : ""}
</form>}
{weixinlogin === true ? <iframe
</p>
:""
}
</form>
{/* {weixinlogin === true ? <iframe
className={"weixinheight390"}
frameBorder="0"
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> : ""}
{weixinlogin === true ? <p className="clearfix ">
<a className={"startlogin color-blue"} onClick={() => this.hideweixinlogin()}>返回账号登录</a>
</p> : ""}
</p> : ""} */}
</div>
{/*快捷登录*/}
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB