From 762f3a413d3ea11c53a1229995c3526ae951b03e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 16 Jul 2019 10:49:10 +0800 Subject: [PATCH] save --- public/react/src/modules/user/account/AccountBasicEdit.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 7463fa632..f7e58b8de 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -101,7 +101,11 @@ class AccountBasic extends Component { this.props.form.validateFieldsAndScroll((err, values) => { console.log(values); let {basicInfo}=this.props; - if(!err){ + // TODO 为什么modal里的form影响到这里的了 + if (err) { + delete err.depart + } + if(!err || Object.keys(err).length == 0){ let url=`/users/accounts/${basicInfo.id}.json` axios.put((url),{ nickname:values.nickname, @@ -117,7 +121,9 @@ class AccountBasic extends Component { department_id:this.state.department_id }).then((result)=>{ if(result){ + this.props.showNotification('保存成功') this.props.getBasicInfo(); + this.props.history.push('/account/profile') } }).catch((error)=>{ console.log(error);