forked from Gitlink/forgeplus-react
build
This commit is contained in:
parent
a0a83f63f6
commit
a2e3617036
|
|
@ -3,7 +3,7 @@ import { Modal , Form , Input , Button , message} from 'antd';
|
||||||
import './EAccount.scss';
|
import './EAccount.scss';
|
||||||
import axios from 'axios';
|
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;
|
const { getFieldDecorator, validateFields , setFieldsValue } = form;
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
|
|
@ -31,7 +31,12 @@ function EducoderAccount({form , visible , current_user , onCancel,isCancel}){
|
||||||
function onSure(){
|
function onSure(){
|
||||||
validateFields((error,values)=>{
|
validateFields((error,values)=>{
|
||||||
if(!error){
|
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}){
|
||||||
<Form {...layout}>
|
<Form {...layout}>
|
||||||
<Form.Item label="邮箱">
|
<Form.Item label="邮箱">
|
||||||
{getFieldDecorator("email",{
|
{getFieldDecorator("email",{
|
||||||
rules:[{required:true,message:"请输入邮箱账号"}]
|
rules:[
|
||||||
|
{required:true,message:"请输入邮箱账号"}
|
||||||
|
]
|
||||||
})(
|
})(
|
||||||
<Input placeholder="请输入您的邮箱账号" width="220px" disabled={current_user && current_user.email}/>
|
<Input placeholder="请输入您的邮箱账号" width="220px" disabled={current_user && current_user.email}/>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ function Profile({
|
||||||
showCompeleteDialog ,
|
showCompeleteDialog ,
|
||||||
completeProfile,
|
completeProfile,
|
||||||
className ,
|
className ,
|
||||||
current_user,checkIfLogin,showLoginDialog
|
current_user,checkIfLogin,showLoginDialog,showNotification
|
||||||
}) {
|
}) {
|
||||||
const [ giteaVisible , setGiteaVisible ] = useState(false);
|
const [ giteaVisible , setGiteaVisible ] = useState(false);
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ function Profile({
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<EducoderAccount visible={giteaVisible} onCancel={()=>setGiteaVisible(false)} current_user={current_user}/>
|
<EducoderAccount showNotification={showNotification} visible={giteaVisible} onCancel={()=>setGiteaVisible(false)} current_user={current_user}/>
|
||||||
<a className={className} onClick={checkProfile}>{children}</a>
|
<a className={className} onClick={checkProfile}>{children}</a>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -436,7 +436,9 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<EducoderAccount visible={giteaVisible} isCancel={false} onCancel={()=>{
|
<EducoderAccount visible={giteaVisible} isCancel={false}
|
||||||
|
showNotification={this.props.showNotification}
|
||||||
|
onCancel={()=>{
|
||||||
message.info('未填邮箱及密码,可能影响协同开发部分功能的使用');this.setState({giteaVisible:false})
|
message.info('未填邮箱及密码,可能影响协同开发部分功能的使用');this.setState({giteaVisible:false})
|
||||||
}} current_user={this.props.current_user}/>
|
}} current_user={this.props.current_user}/>
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
|
|
|
||||||
|
|
@ -260,6 +260,7 @@ export function TPMIndexHOC(WrappedComponent) {
|
||||||
onCancel={()=>{
|
onCancel={()=>{
|
||||||
message.info('未填邮箱及密码,可能影响协同开发部分功能的使用');this.setState({giteaVisible:false})
|
message.info('未填邮箱及密码,可能影响协同开发部分功能的使用');this.setState({giteaVisible:false})
|
||||||
}}
|
}}
|
||||||
|
showNotification={this.props.showNotification}
|
||||||
current_user={current_user}
|
current_user={current_user}
|
||||||
/>
|
/>
|
||||||
<ProfileModal
|
<ProfileModal
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue