forked from Gitlink/forgeplus-react
邮箱弹框点击事件
This commit is contained in:
parent
585cf95840
commit
5cc7f51505
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue