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

This commit is contained in:
caishi 2021-03-19 13:44:02 +08:00
parent fbdde52651
commit 284bf67f82
1 changed files with 7 additions and 6 deletions

View File

@ -30,7 +30,8 @@ export function TPMIndexHOC(WrappedComponent) {
isloginCancel: undefined,
mygetHelmetapi: null,
giteaVisible:false,
email:undefined
email:undefined,
is_sync_pwd:undefined
}
}
@ -168,10 +169,11 @@ export function TPMIndexHOC(WrappedComponent) {
if (this.props.match.path === "/" && response.data.login) {
this.props.history.push(`/users/${response.data.login}`);
}
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
})
}
}
@ -356,8 +358,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,{
@ -434,7 +436,6 @@ export function TPMIndexHOC(WrappedComponent) {
>
</WrappedComponent>
}
</div>
</Spin>
<NewFooter