diff --git a/src/forge/Component/EducoderAccount.jsx b/src/forge/Component/EducoderAccount.jsx
index fbf4d6cf4..63c3fe4a9 100644
--- a/src/forge/Component/EducoderAccount.jsx
+++ b/src/forge/Component/EducoderAccount.jsx
@@ -3,7 +3,7 @@ import { Modal , Form , Input , Button , message} from 'antd';
import './EAccount.scss';
import axios from 'axios';
-function EducoderAccount({form , visible , current_user , onCancel,isCancel}){
+function EducoderAccount({form , visible , current_user , onCancel,isCancel,showNotification}){
const { getFieldDecorator, validateFields , setFieldsValue } = form;
useEffect(()=>{
@@ -31,7 +31,12 @@ function EducoderAccount({form , visible , current_user , onCancel,isCancel}){
function onSure(){
validateFields((error,values)=>{
if(!error){
- onOk(values);
+ let reg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
+ if (reg.test(values.email)) {
+ onOk(values);
+ }else{
+ showNotification && showNotification("请输入正确的邮箱账号!");
+ }
}
})
}
@@ -63,7 +68,9 @@ function EducoderAccount({form , visible , current_user , onCancel,isCancel}){
{getFieldDecorator("email",{
- rules:[{required:true,message:"请输入邮箱账号"}]
+ rules:[
+ {required:true,message:"请输入邮箱账号"}
+ ]
})(
)}
diff --git a/src/forge/Component/ProfileModal/Profile.jsx b/src/forge/Component/ProfileModal/Profile.jsx
index 0613cd9d0..2ae769ebe 100644
--- a/src/forge/Component/ProfileModal/Profile.jsx
+++ b/src/forge/Component/ProfileModal/Profile.jsx
@@ -8,7 +8,7 @@ function Profile({
showCompeleteDialog ,
completeProfile,
className ,
- current_user,checkIfLogin,showLoginDialog
+ current_user,checkIfLogin,showLoginDialog,showNotification
}) {
const [ giteaVisible , setGiteaVisible ] = useState(false);
@@ -30,7 +30,7 @@ function Profile({
return(
- setGiteaVisible(false)} current_user={current_user}/>
+ setGiteaVisible(false)} current_user={current_user}/>
{children}
)
diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js
index 02236cc6c..ab6542f17 100644
--- a/src/forge/New/Index.js
+++ b/src/forge/New/Index.js
@@ -436,7 +436,9 @@ class Index extends Component {
}
}
- {
+ {
message.info('未填邮箱及密码,可能影响协同开发部分功能的使用');this.setState({giteaVisible:false})
}} current_user={this.props.current_user}/>
diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js
index 8b5f167ba..2b53d73e7 100644
--- a/src/modules/tpm/TPMIndexHOC.js
+++ b/src/modules/tpm/TPMIndexHOC.js
@@ -260,6 +260,7 @@ export function TPMIndexHOC(WrappedComponent) {
onCancel={()=>{
message.info('未填邮箱及密码,可能影响协同开发部分功能的使用');this.setState({giteaVisible:false})
}}
+ showNotification={this.props.showNotification}
current_user={current_user}
/>