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 =