第三方登录

This commit is contained in:
何童崇 2022-10-26 11:28:32 +08:00
parent 9e55dd084b
commit 26d853ad38
6 changed files with 69 additions and 38 deletions

View File

@ -159,3 +159,15 @@
.MuiModal-root-15 {
z-index: 10001 !important;
}
.thirdBox{
margin-top: 10px;
display: flex;
justify-content: space-around;
}
.thirdLog{
width: 120px;
}
.gitLinkLog{
background-color: #1b2440;
}

View File

@ -6,6 +6,8 @@ import { notification } from 'antd';
import axios from 'axios';
import educoderLogo from './educoder.png';
import openKylin from './openKylin.svg';
import gitLink from './gitLink.png';
import './LoginDialog.css';
import { broadcastChannelPostMessage } from 'educoder'
@ -104,7 +106,7 @@ class LoginDialog extends Component {
Phonenumberisnotcobool: false,
weixinlogin: false,
qqlogin: false,
settings:undefined,
settings: undefined,
};
}
enter = (num) => {
@ -368,7 +370,7 @@ class LoginDialog extends Component {
let url = '/accounts/login.json'
axios.post(url, {
login: newloginValue,
password: Base64.encode(newpassValue),
password: Base64.encode(newpassValue),
autologin: isGoingValue
}
).then((response) => {
@ -380,7 +382,7 @@ class LoginDialog extends Component {
const messge = (
<div>
<p>登录密码出错已达上限账号已被锁定</p>
<p className="mt10">请10分钟后重新登录或<a href="/resetPassword" style={{textDecoration: "underline",color: "#4CACFF"}}>找回密码</a></p>
<p className="mt10">请10分钟后重新登录或<a href="/resetPassword" style={{ textDecoration: "underline", color: "#4CACFF" }}>找回密码</a></p>
</div>
)
this.openNotifications(messge);
@ -459,14 +461,14 @@ class LoginDialog extends Component {
}
render() {
let { login, isGoing, isGoingValue, disabled , Phonenumberisnotco , dialogBox, isRender, weixinlogin, settings } = this.state;
let { login, isGoing, isGoingValue, disabled, Phonenumberisnotco, dialogBox, isRender, weixinlogin, settings } = this.state;
if (isRender === undefined) {
isRender = false
}
const main_web_site_url =localStorage.chromesetting && JSON.parse(localStorage.chromesetting).main_web_site_url;
const current_main_site_url =localStorage.chromesetting && JSON.parse(localStorage.chromesetting).current_main_site_url;
const main_web_site_url = localStorage.chromesetting && JSON.parse(localStorage.chromesetting).main_web_site_url;
const current_main_site_url = localStorage.chromesetting && JSON.parse(localStorage.chromesetting).current_main_site_url;
return (
<Dialog open={true} id="DialogID"
@ -528,8 +530,8 @@ class LoginDialog extends Component {
<div style={{ height: '25px' }}><p className="color-orange edu-txt-left none" id="username_error_notice"
style={{ display: Phonenumberisnotco === undefined ? 'none' : 'block' }}>{Phonenumberisnotco}</p></div>
<div>
<input
type="password"
<input
type="password"
id="password_loggin_input"
name="password"
ref="passwordText"
@ -540,7 +542,7 @@ class LoginDialog extends Component {
this.loginEDU : () => {
}
}
placeholder="请输入登录密码"
placeholder="请输入登录密码"
/>
<div style={{ height: '25px' }}>
<p className="color-orange edu-txt-left none" id="password_error_notice">
@ -573,21 +575,22 @@ class LoginDialog extends Component {
</span>
</p>
{
settings && settings.third_party && settings.third_party.length > 0 ?
<p className="clearfix mt20">
<span className={"startlogin"}> 快速登录 </span>
<div className={"mt10"}>
{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>
:""
settings && settings.third_party_test && settings.third_party_test.length > 0 ?
<p className="clearfix mt20">
<span className={"startlogin"}> 快速登录 </span>
<div className="thirdBox">
{settings.third_party_test.map((item, key) => {
return (
<a href={`${item.url}`}>
{item.name === "GitLink" && <img className="gitLinkLog thirdLog" src={gitLink} alt={`${item.name}登录`} />}
{item.name === "Openkyin" && <img className="thirdLog" src={openKylin} alt={`${item.name}登录`} />}
</a>
)
})
}
</div>
</p>
: ""
}
</form>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 5000 1300"><defs><style>.cls-1{fill:url(#未命名的渐变_297);}.cls-2{fill:url(#未命名的渐变_297-2);}.cls-3{fill:url(#未命名的渐变_297-3);}.cls-4{fill:url(#未命名的渐变_297-4);}.cls-5{fill:url(#未命名的渐变_305);}.cls-6{fill:url(#未命名的渐变_297-5);}.cls-7{fill:url(#未命名的渐变_297-6);}.cls-8{fill:url(#未命名的渐变_297-7);}.cls-9{fill:url(#未命名的渐变_297-8);}.cls-10{fill:url(#未命名的渐变_297-9);}</style><linearGradient id="未命名的渐变_297" x1="998.5" y1="460.21" x2="998.5" y2="1071.6" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#3da4ff"/><stop offset="1" stop-color="#134bd6"/></linearGradient><linearGradient id="未命名的渐变_297-2" x1="410.03" y1="460.21" x2="410.03" y2="1071.61" xlink:href="#未命名的渐变_297"/><linearGradient id="未命名的渐变_297-3" x1="1586.97" y1="460.21" x2="1586.97" y2="1071.61" xlink:href="#未命名的渐变_297"/><linearGradient id="未命名的渐变_297-4" x1="2175.39" y1="460.21" x2="2175.39" y2="1071.6" xlink:href="#未命名的渐变_297"/><linearGradient id="未命名的渐变_305" x1="2826.98" y1="1050" x2="2826.98" y2="250" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ed5f00"/><stop offset="1" stop-color="#ffc52b"/></linearGradient><linearGradient id="未命名的渐变_297-5" x1="3915.51" y1="460.21" x2="3915.51" y2="1071.61" xlink:href="#未命名的渐变_297"/><linearGradient id="未命名的渐变_297-6" x1="4642.7" y1="460.21" x2="4642.7" y2="1071.6" xlink:href="#未命名的渐变_297"/><linearGradient id="未命名的渐变_297-7" x1="3418.16" y1="460.21" x2="3418.16" y2="1071.61" xlink:href="#未命名的渐变_297"/><linearGradient id="未命名的渐变_297-8" x1="4258.7" y1="460.21" x2="4258.7" y2="1071.61" xlink:href="#未命名的渐变_297"/><linearGradient id="未命名的渐变_297-9" x1="4258.7" y1="460.21" x2="4258.7" y2="1071.6" xlink:href="#未命名的渐变_297"/></defs><g id="渐变"><path class="cls-1" d="M991,489.06H779.27v.13c-2-.08-4-.13-6.09-.13h0V1050H920.33V954.68H991c128.58,0,232.82-104.23,232.82-232.81S1119.58,489.06,991,489.06Zm0,318.47H920.33V636.21H991a85.66,85.66,0,1,1,0,171.32Z"/><path class="cls-2" d="M410,494C282,494,174.15,580.61,141.89,698.43A278.53,278.53,0,0,0,132,772c0,153.53,124.46,278,278,278S688,925.54,688,772a278.12,278.12,0,0,0-9.86-73.58C645.9,580.61,538.09,494,410,494Zm0,408.84c-72.15,0-130.85-58.7-130.85-130.84S337.88,641.16,410,641.16,540.87,699.86,540.87,772,482.18,902.85,410,902.85Z"/><path class="cls-3" d="M1855.06,698.56l0-.13C1822.11,579.26,1711.29,492,1582.37,494.05c-126,2-231.65,87.94-263.54,204.33a278.44,278.44,0,0,0-9.84,76.2c1.36,149.81,123,272.65,272.8,275.37,118.14,2.15,219.82-69.42,262.16-171.76H1663.43c-.4.29-.79.59-1.2.88a129.64,129.64,0,0,1-71.29,23.71c-1.28,0-2.57,0-3.86.05h-2.35c-.32,0-.63,0-1,0A131.08,131.08,0,0,1,1479,845.58h376.12a278.7,278.7,0,0,0,9.8-78.78A275.35,275.35,0,0,0,1855.06,698.56Zm-376.2-.13a130.7,130.7,0,0,1,216.25,0Z"/><path class="cls-4" d="M2175.39,518.23a224.08,224.08,0,0,0-135,45.09,146.5,146.5,0,0,0-90.21-30.9h0V1050h147.15V743.5a78.12,78.12,0,1,1,156.23,0V1050h147.15V743.5C2400.66,619.28,2299.61,518.23,2175.39,518.23Z"/><polygon class="cls-5" points="3168.14 250 2897.14 250 2695.68 496.54 2695.68 496.09 2695.68 250 2485.82 250 2485.82 496.09 2485.82 496.09 2485.82 753.37 2485.82 1050 2514.45 1050 2695.68 1050 2695.68 828.2 2695.68 828.2 2742.99 770.31 2897.14 1050 3168.14 1050 2889.52 590.99 3168.14 250"/><polygon class="cls-6" points="3878.21 489.06 3731.06 489.06 3731.06 902.85 3731.06 1050 3878.21 1050 4025.36 1050 4099.97 1050 4099.97 902.85 3878.21 902.85 3878.21 489.06"/><path class="cls-7" d="M4642.7,518.23a224.08,224.08,0,0,0-135.05,45.09,146.54,146.54,0,0,0-90.21-30.9V1050h147.15V743.5a78.12,78.12,0,1,1,156.23,0V1050H4868V743.5C4868,619.28,4766.91,518.23,4642.7,518.23Z"/><path class="cls-8" d="M3498.75,673.56A80.59,80.59,0,0,1,3340,693.09a251.94,251.94,0,0,1-2.41-34V489.06H3190.41v184.5c0,99.84,64.59,184.88,154.17,215.54V1050h147.15V889.1h0c89.58-30.66,154.17-115.7,154.17-215.54V489.06H3498.75Z"/><rect class="cls-9" x="4185.13" y="489.06" width="147.15" height="99.06"/><rect class="cls-10" x="4185.13" y="627.13" width="147.15" height="422.87"/></g></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -2,9 +2,11 @@ import React, { useEffect, useState } from "react";
import { Form, Input, Button, Checkbox } from "antd";
import { Link } from "react-router-dom";
import axios from 'axios';
import educoderLogo from '../login/educoder.png';
// import educoderLogo from '../login/educoder.png';
import openKylin from '../login/openKylin.svg';
import gitLink from '../login/gitLink.png';
import cookie from 'react-cookies';
import { getImageUrl} from 'educoder';
import { getImageUrl } from 'educoder';
import './LoginRegisterPage.scss';
function Login(props) {
@ -114,18 +116,20 @@ function Login(props) {
</Form>
{
setting && setting.third_party && setting.third_party.length > 0 ?
<p className="quick_logon">
<p className="quick_logon_p"></p>
<span className={"startlogin"}>&nbsp;快速登录&nbsp;</span>
{setting.third_party.map((item, key) => {
return (
<a href={`${item.url}`}>
<img src={item.name === "educoder" ? educoderLogo : ""} width="46px" alt={`${item.name}登录`} />
</a>
)
})
}
settings && settings.third_party_test && settings.third_party_test.length > 0 ?
<p className="clearfix mt20">
<span className={"startlogin"}> 快速登录 </span>
<div className="thirdBox">
{settings.third_party_test.map((item, key) => {
return (
<a href={`${item.url}`}>
{item.name === "GitLink" && <img className="gitLinkLog thirdLog" src={gitLink} alt={`${item.name}登录`} />}
{item.name === "Openkyin" && <img className="thirdLog" src={openKylin} alt={`${item.name}登录`} />}
</a>
)
})
}
</div>
</p>
: ""
}

View File

@ -9,6 +9,17 @@
background-repeat: no-repeat;
background-position: center;
}
.thirdBox{
margin-top: 10px;
display: flex;
justify-content: space-around;
}
.thirdLog{
width: 120px;
}
.gitLinkLog{
background-color: #1b2440;
}
/*当页面宽度大于1000px*/
@media screen and (min-width:1000px) {
.banner{