第三方登录-修改邮箱和密码

This commit is contained in:
caishi 2021-04-02 18:40:59 +08:00
parent 648c6e235b
commit ab052ebace
3 changed files with 36 additions and 10 deletions

View File

@ -0,0 +1,9 @@
.ant-modal-mask{
z-index: 10000;
}
.ant-modal-wrap{
z-index: 10001;
.ant-form-explain{
position: absolute;
}
}

View File

@ -35,19 +35,14 @@ function EducoderAccount({form , visible , onOk , email}){
>
<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}/>
<Input placeholder="请输入您的邮箱账号" width="220px"/>
)}
</Form.Item>
<Form.Item label="密码">

View File

@ -29,7 +29,7 @@ export function TPMIndexHOC(WrappedComponent) {
dataquerys: {},
isloginCancel: undefined,
mygetHelmetapi: null,
giteaVisible:true,
giteaVisible:false,
email:undefined
}
}
@ -168,6 +168,14 @@ export function TPMIndexHOC(WrappedComponent) {
if (this.props.match.path === "/" && response.data.login) {
this.props.history.push(`/users/${response.data.login}`);
}
if(response.data && response.data.login){
if(response.data.need_edit_info){
this.setState({
giteaVisible:true,
email:response.data.email
})
}
}
}
}).catch((error) => {
console.log(error)
@ -348,10 +356,24 @@ export function TPMIndexHOC(WrappedComponent) {
}
}
onOk=()=>{
onOk =(values)=>{
let url = `/users/sync_user_info.json`;
const { current_user } = this.state;
axios.post(url,{
login:current_user && current_user.login,
...values
}).then(result=>{
if(result && result.data && result.data.status === 0){
this.setState({
giteaVisible:false,
email:undefined
})
window.location.reload();
}
}).catch(error=>{})
}
render() {
let { Footerdown, isRender, AccountProfiletype, AccountPhoneemailtype, current_user , giteaVisible , email } = this.state;
const common = {