educoder和forge用户的密码是否一致

This commit is contained in:
caishi 2021-03-19 13:44:02 +08:00 committed by caishi
parent f14443a6e8
commit 76ed232f6a
1 changed files with 7 additions and 5 deletions

View File

@ -29,7 +29,8 @@ export function TPMIndexHOC(WrappedComponent) {
giteaVisible:false,
email:undefined,
completeProfile:false,
showCP:false
showCP:false,
is_sync_pwd:undefined
}
}
@ -170,10 +171,11 @@ export function TPMIndexHOC(WrappedComponent) {
})
}
}
if(!response.data.has_gitea_user){
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
})
}
}
@ -225,8 +227,8 @@ export function TPMIndexHOC(WrappedComponent) {
onOk =(values)=>{
let url = `/accounts/gitea_regsiter.json`;
const { email , current_user } = this.state;
if(email){
const { email , current_user , is_sync_pwd } = this.state;
if(email && !is_sync_pwd){
url = `/users/change_password.json`;
}
axios.post(url,{