Просмотр исходного кода

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

zhanghe 6 лет назад
Родитель
Сommit
ef66963ba0
2 измененных файлов с 2 добавлено и 2 удалено
  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 { routerRedux } from 'dva/router';
 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';
 
 const genders = [{

+ 1 - 1
src/utils/utils.js

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