邮箱弹框点击事件

This commit is contained in:
caishi 2021-06-11 17:21:11 +08:00
parent 585cf95840
commit 5cc7f51505
1 changed files with 10 additions and 5 deletions

View File

@ -24,7 +24,8 @@ export function TPMIndexHOC(WrappedComponent) {
isloginCancel: undefined,
mygetHelmetapi: null,
giteaVisible:false,
email:undefined
email:undefined,
is_sync_pwd:undefined
}
}
@ -157,10 +158,11 @@ export function TPMIndexHOC(WrappedComponent) {
this.props.history.push(`/users/${response.data.login}`);
}
if(response.data && response.data.login){
if(response.data.need_edit_info){
if(!response.data.has_gitea_user || (response.data.has_gitea_user && !response.data.is_sync_pwd)){
this.setState({
giteaVisible:true,
email:response.data.email
email:response.data.email,
is_sync_pwd:response.data.is_sync_pwd
})
}
}
@ -188,8 +190,11 @@ export function TPMIndexHOC(WrappedComponent) {
}
onOk =(values)=>{
let url = `/users/sync_user_info.json`;
const { current_user } = this.state;
let url = `/accounts/gitea_register.json`;
const { email , current_user , is_sync_pwd } = this.state;
if(email && !is_sync_pwd){
url = `/users/change_password.json`;
}
axios.post(url,{
login:current_user && current_user.login,
...values