Browse Source

:bug: 系统用户昵称为空时页面异常bug修复

zhanghe 6 years atrás
parent
commit
ef66963ba0
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/routes/System/CmsUser/CmsUserEdit.js
  2. 1 1
      src/utils/utils.js

+ 1 - 1
src/routes/System/CmsUser/CmsUserEdit.js

@@ -3,7 +3,7 @@ import { Card, Form, Table, Input, Button, Radio, Icon, Switch, message } from '
 import { connect } from 'dva';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { routerRedux } from 'dva/router';
 import FooterToolbar from '../../../components/FooterToolbar';
 import FooterToolbar from '../../../components/FooterToolbar';
-import {renderAvatar, renderGender, renderStatus, boolToStatus, statusToBool} from '../../../utils/utils';
+import { renderAvatar, renderGender, renderStatus, boolToStatus, statusToBool } from '../../../utils/utils';
 import styles from './CmsUserCreate.less';
 import styles from './CmsUserCreate.less';
 
 
 const genders = [{
 const genders = [{

+ 1 - 1
src/utils/utils.js

@@ -283,7 +283,7 @@ export function renderAvatar(avatar, name) {
         verticalAlign: 'middle',
         verticalAlign: 'middle',
       }}
       }}
     >
     >
-      {name[0]}
+      {name && name[0]}
     </Avatar>
     </Avatar>
   );
   );
 }
 }