Преглед на файлове

修复管理员添加新账号的bug

yee преди 7 години
родител
ревизия
873f6da8f3
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      js/component/manageCenter/set/modal.jsx

+ 3 - 2
js/component/manageCenter/set/modal.jsx

@@ -180,6 +180,7 @@ const TheModal = React.createClass({
     handleCancel() {
         this.setState({
             visible: false,
+            locations:[]
         });
         this.props.handleReturn(false, false);
     },
@@ -277,7 +278,7 @@ const TheModal = React.createClass({
                 this.state.theSwitch = true;
                 for (let i = 0; i < data.data.length; i++) {
                     for (let n = 0; n < this.props.currentRoles.length; n++) {
-                        if (data.data[i] === this.props.currentRoles[n]) {
+                        if (data.data[i] === this.props.currentRoles[n] && uid != 1) {
                             this.state.theSwitch = false;
                         }
                     }
@@ -336,7 +337,7 @@ const TheModal = React.createClass({
             email: nextProps.data ? nextProps.data.email : '',
             mobile: nextProps.data ? nextProps.data.mobile : '',
             position: nextProps.data ? nextProps.data.position : '',
-            superiorId: nextProps.data ? nextProps.data.superiorId : '',
+            superiorId: nextProps.data ? nextProps.data.superiorId : '',    
         };
         this.setState(nextState)
     },