diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 432673bd2..8af24022d 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -201,7 +201,7 @@ class AccountBasic extends Component { this.props.form.setFieldsValue({ org2:e }) - let arr = this.state.departments ? this.state.departments.filter(function(item){ + let arr = this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){ return item.name.indexOf(e) > -1 }) : [] this.setState({ @@ -213,9 +213,9 @@ class AccountBasic extends Component { // 选择部门、学院 changeDepartment=(e)=>{ - let arr=this.state.departments.filter(function(item){ + let arr= this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){ return item.name == e; - }); + }) : []; this.setState({ departmentsName:e, department_id:arr[0].id