forked from Gitlink/forgeplus-react
第三方账号密码重置
This commit is contained in:
parent
96253f3f58
commit
648c6e235b
|
@ -0,0 +1,65 @@
|
|||
import React , {forwardRef, useEffect} from 'react';
|
||||
import { Modal , Form , Input , Button } from 'antd';
|
||||
import './EAccount.scss';
|
||||
|
||||
function EducoderAccount({form , visible , onOk , email}){
|
||||
const { getFieldDecorator, validateFields , setFieldsValue } = form;
|
||||
|
||||
useEffect(()=>{
|
||||
if(email){
|
||||
setFieldsValue({email})
|
||||
}
|
||||
},[email])
|
||||
|
||||
function onSure(){
|
||||
validateFields((error,values)=>{
|
||||
if(!error){
|
||||
onOk(values);
|
||||
}
|
||||
})
|
||||
}
|
||||
const layout = {
|
||||
labelCol: { span: 5 },
|
||||
wrapperCol: { span: 18 },
|
||||
};
|
||||
return(
|
||||
<Modal
|
||||
visible={visible}
|
||||
title="提示"
|
||||
width="500px"
|
||||
closable={false}
|
||||
footer={
|
||||
<Button type="primary" onClick={onSure}>确定</Button>
|
||||
}
|
||||
centered
|
||||
>
|
||||
<div>
|
||||
<p className="mb15 edu-txt-center" style={{maxWidth:"350px",margin:"0px auto"}}>
|
||||
{
|
||||
email ?
|
||||
`平台已检测到您已绑定邮箱${email},请您确认如下操作`
|
||||
:
|
||||
"平台已检测到您未绑定邮箱,为不影响使用协同开发功能,请先绑定邮箱"
|
||||
}
|
||||
</p>
|
||||
<Form {...layout}>
|
||||
<Form.Item label="邮箱">
|
||||
{getFieldDecorator("email",{
|
||||
rules:[{required:true,message:"请输入邮箱账号"}]
|
||||
})(
|
||||
<Input placeholder="请输入您的邮箱账号" width="220px" disabled={email}/>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item label="密码">
|
||||
{getFieldDecorator("password",{
|
||||
rules:[{required:true,message:"请输入邮箱密码"}]
|
||||
})(
|
||||
<Input.Password placeholder="请输入您的邮箱密码" width="220px"/>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
export default Form.create()(forwardRef(EducoderAccount));
|
|
@ -8,6 +8,7 @@ import './TPMIndex.css';
|
|||
import LoginDialog from '../login/LoginDialog';
|
||||
import AccountProfile from '../user/AccountProfile';
|
||||
import AccountPhoneemail from '../user/AccountPhoneemail';
|
||||
import EducoderAccount from '../../forge/Component/EducoderAccount';
|
||||
|
||||
export function TPMIndexHOC(WrappedComponent) {
|
||||
return class II extends React.Component {
|
||||
|
@ -28,6 +29,8 @@ export function TPMIndexHOC(WrappedComponent) {
|
|||
dataquerys: {},
|
||||
isloginCancel: undefined,
|
||||
mygetHelmetapi: null,
|
||||
giteaVisible:true,
|
||||
email:undefined
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,8 +348,12 @@ export function TPMIndexHOC(WrappedComponent) {
|
|||
}
|
||||
}
|
||||
|
||||
onOk=()=>{
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
let { Footerdown, isRender, AccountProfiletype, AccountPhoneemailtype, current_user } = this.state;
|
||||
let { Footerdown, isRender, AccountProfiletype, AccountPhoneemailtype, current_user , giteaVisible , email } = this.state;
|
||||
const common = {
|
||||
|
||||
showLoginDialog: this.showLoginDialog,
|
||||
|
@ -372,6 +379,7 @@ export function TPMIndexHOC(WrappedComponent) {
|
|||
};
|
||||
return (
|
||||
<div className="indexHOC">
|
||||
<EducoderAccount visible={giteaVisible} email={email} onOk={this.onOk}/>
|
||||
{isRender === true ? <LoginDialog
|
||||
Modifyloginvalue={() => this.hideLoginDialog()}
|
||||
{...this.props}
|
||||
|
|
Loading…
Reference in New Issue