From 648c6e235bb956364da60b319a70a09ca0c077ef Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 2 Apr 2021 17:39:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Component/EducoderAccount.jsx | 65 +++++++++++++++++++++++++ src/modules/tpm/TPMIndexHOC.js | 10 +++- 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 src/forge/Component/EducoderAccount.jsx diff --git a/src/forge/Component/EducoderAccount.jsx b/src/forge/Component/EducoderAccount.jsx new file mode 100644 index 00000000..b9b2f7af --- /dev/null +++ b/src/forge/Component/EducoderAccount.jsx @@ -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( + 确定 + } + centered + > +
+

+ { + email ? + `平台已检测到您已绑定邮箱${email},请您确认如下操作` + : + "平台已检测到您未绑定邮箱,为不影响使用协同开发功能,请先绑定邮箱" + } +

+
+ + {getFieldDecorator("email",{ + rules:[{required:true,message:"请输入邮箱账号"}] + })( + + )} + + + {getFieldDecorator("password",{ + rules:[{required:true,message:"请输入邮箱密码"}] + })( + + )} + +
+
+
+ ) +} +export default Form.create()(forwardRef(EducoderAccount)); \ No newline at end of file diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index 0a1d1c48..0dabc332 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -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 (
+ {isRender === true ? this.hideLoginDialog()} {...this.props}