dev_forum
杨树林 6 years ago
parent 4dbd560f1b
commit a2d2590ec2

@ -274,7 +274,7 @@ class App extends Component {
<Switch> <Switch>
{/*<Route path="/login" component={LoginRegisterPage}/>*/} {/*<Route path="/login" component={LoginRegisterPage}/>*/}
{/*认证*/} {/*认证*/}
<Route path="/profile" component={AccountPage}/> <Route path="/account" component={AccountPage}/>
{/*403*/} {/*403*/}
<Route path="/403" component={Shixunauthority}/> <Route path="/403" component={Shixunauthority}/>

@ -754,7 +754,7 @@ submittojoinclass=(value)=>{
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li>
<li><a href={`/profile/basic`}>账号管理</a></li> <li><a href={`/account/profile`}>账号管理</a></li>
{/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/} {/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/}
{/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/} {/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/}
{/*<li><Link to={`/interest`}>兴趣页</Link></li>*/} {/*<li><Link to={`/interest`}>兴趣页</Link></li>*/}

@ -55,7 +55,7 @@ class AccountPage extends Component {
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
if(result.data){ if(result.data){
if(result.data && result.data.base_info_completed == false){ if(result.data && result.data.base_info_completed == false){
this.props.history.push(`/profile/basic/edit`); this.props.history.push(`/account/profile/edit`);
} }
this.setState({ this.setState({
basicInfo: Object.assign({}, {...result.data}, { avatar_url: `${result.data.avatar_url}?t=${new Date().getTime()}`}) basicInfo: Object.assign({}, {...result.data}, { avatar_url: `${result.data.avatar_url}?t=${new Date().getTime()}`})
@ -79,30 +79,30 @@ class AccountPage extends Component {
<AccountNav {...this.props} {...common}></AccountNav> <AccountNav {...this.props} {...common}></AccountNav>
<div className="basicFormWrap"> <div className="basicFormWrap">
<Switch {...this.props}> <Switch {...this.props}>
<Route exact path="/profile/basic" <Route exact path="/account/profile"
render={ render={
(props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />) (props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route exact path="/profile/basic/edit" <Route exact path="/account/profile/edit"
render={ render={
(props) => (<AccountBasicEdit {...this.props} {...props} {...this.state} {...common} />) (props) => (<AccountBasicEdit {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route exact path="/profile/certification" <Route exact path="/account/certification"
render={ render={
(props) => (<AccountCertification {...this.props} {...props} {...this.state} {...common} />) (props) => (<AccountCertification {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route exact path="/profile/secure" <Route exact path="/account/secure"
render={ render={
(props) => (<AccountSecure {...this.props} {...props} {...this.state} {...common} />) (props) => (<AccountSecure {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route exact path="/profile" <Route exact path="/account"
render={ render={
(props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />) (props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />)
} }

@ -54,7 +54,7 @@ class AccountBasicEdit extends Component {
<div className="titleWrap"> <div className="titleWrap">
<div className="title">基本信息</div> <div className="title">基本信息</div>
<Button type="primary" style={{ marginRight: '16px'}} <Button type="primary" style={{ marginRight: '16px'}}
ghost onClick={() => this.props.history.push('/profile/basic/edit')}>修改</Button> ghost onClick={() => this.props.history.push('/account/profile/edit')}>修改</Button>
</div> </div>
<Form onSubmit={this.handleSubmit}> <Form onSubmit={this.handleSubmit}>

@ -4,19 +4,19 @@ import { SnackbarHOC, getImageUrl } from 'educoder';
import AccountImg from './AccountImg' import AccountImg from './AccountImg'
class AccountNav extends Component { class AccountNav extends Component {
toBasic = () => { toBasic = () => {
this.props.history.push(`/profile/basic`) this.props.history.push(`/account/profile`)
} }
toCertification = () => { toCertification = () => {
this.props.history.push(`/profile/certification`) this.props.history.push(`/account/certification`)
} }
toSecure = () => { toSecure = () => {
this.props.history.push(`/profile/secure`) this.props.history.push(`/account/secure`)
} }
render() { render() {
let { basicInfo } = this.props let { basicInfo } = this.props
console.log(this.props); console.log(this.props);
const path = window.location.pathname const path = window.location.pathname
const isBasic = path.indexOf('basic') != -1 || path == "/profile" const isBasic = path.indexOf('basic') != -1 || path == "/account"
const isCertification = path.indexOf('certification') != -1 const isCertification = path.indexOf('certification') != -1
const isSecure = path.indexOf('secure') != -1 const isSecure = path.indexOf('secure') != -1
return ( return (

Loading…
Cancel
Save