|
|
|
@ -153,20 +153,28 @@ class AccountSecure extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
onPasswordSubmit = () => {
|
|
|
|
|
let {basicInfo}=this.props;
|
|
|
|
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
|
|
|
|
if (!err) {
|
|
|
|
|
if(basicInfo&&basicInfo.has_password===true){
|
|
|
|
|
if(values.p_old == values.p_new){
|
|
|
|
|
this.props.showNotification("新密码不能与旧密码相同!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(values.p_again != values.p_new){
|
|
|
|
|
this.props.showNotification("两次输入的新密码必须一致!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let {login}=this.props.current_user;
|
|
|
|
|
let url=`/users/accounts/${login}/password.json`;
|
|
|
|
|
let p_old=undefined;
|
|
|
|
|
if(basicInfo&&basicInfo.has_password===true){
|
|
|
|
|
p_old=values.p_old
|
|
|
|
|
}
|
|
|
|
|
axios.put((url),{
|
|
|
|
|
old_password:values.p_old,
|
|
|
|
|
old_password:p_old,
|
|
|
|
|
password:values.p_new
|
|
|
|
|
}).then((result)=>{
|
|
|
|
|
if(result){
|
|
|
|
@ -215,6 +223,8 @@ class AccountSecure extends Component {
|
|
|
|
|
let {basicInfo}=this.props;
|
|
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
|
|
|
const { updating,seconds,secondsFlag } = this.state
|
|
|
|
|
|
|
|
|
|
console.log(basicInfo&&basicInfo.has_password)
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<div className="basicForm settingForm">
|
|
|
|
@ -426,7 +436,7 @@ class AccountSecure extends Component {
|
|
|
|
|
|
|
|
|
|
{ updating == PASSWORD &&
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<Form.Item
|
|
|
|
|
{basicInfo&&basicInfo.has_password===true?<Form.Item
|
|
|
|
|
label="旧密码"
|
|
|
|
|
className="mb20 formItemInline hideRequireTag"
|
|
|
|
|
>
|
|
|
|
@ -439,7 +449,7 @@ class AccountSecure extends Component {
|
|
|
|
|
})(
|
|
|
|
|
<Input type="password" placeholder="请设置8~16位密码,区分大小写" autoComplete="new-password"></Input>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Form.Item>:""}
|
|
|
|
|
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="新密码"
|
|
|
|
|