From b80b75dfdf5da9ad110be2370f9e7d8cfe689e07 Mon Sep 17 00:00:00 2001 From: qitmac000249 Date: Fri, 11 Aug 2017 12:19:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=A1=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/containers/User/Profile.js | 54 ++++++++++++++++++++----------- client/containers/User/User.js | 37 ++++++++++++++------- client/containers/User/index.scss | 27 ++++++++++------ 3 files changed, 79 insertions(+), 39 deletions(-) diff --git a/client/containers/User/Profile.js b/client/containers/User/Profile.js index e6e04912..f755350c 100644 --- a/client/containers/User/Profile.js +++ b/client/containers/User/Profile.js @@ -3,11 +3,23 @@ import { Row, Col, Input, Button, Select, message, Upload, Icon } from 'antd' import axios from 'axios'; import {formatTime} from '../../common.js' import PropTypes from 'prop-types' +import { connect } from 'react-redux' + +@connect(state=>{ + return { + curUid: state.user.uid, + userType: state.user.type + } +},{ + +}) class Profile extends Component { static propTypes = { - match: PropTypes.object + match: PropTypes.object, + curUid: PropTypes.number, + userType: PropTypes.string } constructor(props) { @@ -126,12 +138,21 @@ class Profile extends Component { const Option = Select.Option; let userinfo = this.state.userinfo; let _userinfo = this.state._userinfo; - let roles = { admin: '管理员', member: '会员' } + let roles = { admin: '管理员', member: '会员' }; + let userType = ""; + if(this.props.userType === "third"){ + userType = false; + }else if(this.props.userType === "site"){ + userType = true; + }else{ + userType = false; + } + if (this.state.usernameEdit === false) { userNameEditHtml =
{userinfo.username}   {/* { this.handleEdit('usernameEdit', true) }}>修改*/} - + {userType?:""}
} else { userNameEditHtml =
@@ -147,7 +168,7 @@ class Profile extends Component { emailEditHtml =
{userinfo.email}   {/* { this.handleEdit('emailEdit', true) }} >修改*/} - + {userType?:""}
} else { emailEditHtml =
@@ -163,7 +184,7 @@ class Profile extends Component { roleEditHtml =
{roles[userinfo.role]}   {/* { this.handleEdit('roleEdit', true) }} >修改*/} - + {userType?:""}
} else { roleEditHtml =