From 8b6ca86a83c69e0506a24166e33907b29c0294b0 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 19 Jul 2019 15:57:29 +0800 Subject: [PATCH] hidden --- .../src/modules/user/account/AccountBasic.js | 4 ++-- .../modules/user/account/AccountBasicEdit.js | 21 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/user/account/AccountBasic.js b/public/react/src/modules/user/account/AccountBasic.js index 80eee8fc7..aef66e5c2 100644 --- a/public/react/src/modules/user/account/AccountBasic.js +++ b/public/react/src/modules/user/account/AccountBasic.js @@ -3,7 +3,7 @@ import React, { Component } from 'react'; import { SnackbarHOC, getImageUrl, City } from 'educoder'; import { Form, Button, Input, Radio, Select, Tooltip, Icon } from 'antd' import './common.css' - +import { getHiddenName } from './AccountBasicEdit' const RadioGroup = Radio.Group; const Option = Select.Option @@ -70,7 +70,7 @@ class AccountBasicEdit extends Component { label="姓名" className="display formItemInline" > - {basicInfo && basicInfo.name} + {basicInfo && (basicInfo.show_realname == true ? basicInfo.name : getHiddenName(basicInfo.name))} { this.setState({ realName: name }) - const newName = this.getHiddenName(name) + const newName = getHiddenName(name) this.props.form.setFieldsValue({ name: newName @@ -406,7 +405,7 @@ class AccountBasic extends Component { { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } :
- {showRealName ? this.props.basicInfo.name : this.getHiddenName(this.props.basicInfo.name)} + {showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)} this.showOrHide(showRealName)}> { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }