修改user路由

This commit is contained in:
何童崇 2021-08-30 10:31:51 +08:00
parent e606147d03
commit eb02b814a9
76 changed files with 330 additions and 312 deletions

View File

@ -3,7 +3,7 @@ import './App.css';
import { ConfigProvider } from 'antd' import { ConfigProvider } from 'antd'
import zhCN from 'antd/lib/locale-provider/zh_CN'; import zhCN from 'antd/lib/locale-provider/zh_CN';
import { import {
BrowserRouter as Router, // BrowserRouter as Router,
Route, Route,
Switch Switch
} from 'react-router-dom'; } from 'react-router-dom';
@ -108,6 +108,12 @@ class App extends Component {
initAxiosInterceptors(this.props); initAxiosInterceptors(this.props);
let pathname = window.location.pathname ? window.location.pathname.split('/')[1] : ''; let pathname = window.location.pathname ? window.location.pathname.split('/')[1] : '';
pathname && this.getPathnameType(pathname); pathname && this.getPathnameType(pathname);
this.unlisten = this.props.history.listen((location,action) => {
// 最新路由的 location 对象,可以通过比较 pathname 是否相同来判断路由的变化情况
let newPathname = location.pathname.split('/')[1];
newPathname&&this.getPathnameType(newPathname);
});
} }
getPathnameType = (pathname) => { getPathnameType = (pathname) => {
@ -124,6 +130,8 @@ class App extends Component {
} }
} }
HideAddcoursestypess = (i) => { HideAddcoursestypess = (i) => {
this.setState({ this.setState({
Addcoursestype: false, Addcoursestype: false,
@ -146,7 +154,14 @@ class App extends Component {
window.addEventListener('error', (event) => { window.addEventListener('error', (event) => {
const msg = `${event.type}: ${event.message}`; const msg = `${event.type}: ${event.message}`;
}); });
} }
componentWillUnmount() {
this.unlisten && this.unlisten(); // 执行解绑
}
//修改登录方法 //修改登录方法
Modifyloginvalue = () => { Modifyloginvalue = () => {
this.setState({ this.setState({
@ -225,121 +240,121 @@ class App extends Component {
<MuiThemeProvider theme={theme}> <MuiThemeProvider theme={theme}>
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={() => this.Modifyloginvalue()}></LoginDialog> <LoginDialog {...this.props} {...this.state} Modifyloginvalue={() => this.Modifyloginvalue()}></LoginDialog>
<SiderBar /> <SiderBar />
<Router> {/* <Router> */}
<Switch> <Switch>
{/* wiki预览 */} {/* wiki预览 */}
<Route path="/projects/:owner/:projectsId/wiki/preview/:projectName/:projectId" render={ <Route path="/projects/:owner/:projectsId/wiki/preview/:projectName/:projectId" render={
(props) => { (props) => {
return (<WikiPreview {...this.props} {...props} {...this.state} />) return (<WikiPreview {...this.props} {...props} {...this.state} />)
}
} />
{/*项目*/}
<Route
path={"/projects/:owner/:projectId/devops/:opsId/detail"}
render={
(props) => {
return (<OpsDetail {...this.props} {...props} {...this.state} />)
}
}>
</Route>
<Route
path={"/settings"}
render={
(props) => {
return (<Security {...this.props} {...props} {...this.state} />)
}
}>
</Route>
{/*项目*/}
<Route
path={"/projects"}
render={
(props) => {
return (<Projects {...this.props} {...props} {...this.state} />)
}
}>
</Route>
<Route
path="/register"
render={
(props) => {
return (<EducoderLogin {...this.props} {...props} {...this.state} />)
}
}
/>
{/*403*/}
<Route path="/403" component={Shixunauthority} />
<Route path="/500" component={http500} />
{/*404*/}
<Route path="/nopage" component={Shixunnopage} />
{/* 查询 */}
<Route path="/search" component={Search} />
<Route exact path="/explore"
render={
(props) => (
personal && personal.length > 0 ?
<InfosIndex {...this.props} {...props} />
:
<ProjectIndex {...this.props} {...props} />
)
}
/>
{/* 判断为用户/组织,并进入对应页面 */}
{
pathType === 'User' ?
<Route exact path="/:username"
render={
(props) => {
return (<InfosIndex {...this.props} {...this.state} />)
}
}
/> : pathType === 'Organization' ? <Route path={"/:OIdentifier"}
render={
(props) => {
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
}
}>
</Route> : pathType === '404' ? <Route path="/nopage" component={Shixunnopage} /> : <Loading />
} }
} />
{/*项目*/}
{/* 组织 */} <Route
{/* <Route path={"/organize"} path={"/projects/:owner/:projectId/devops/:opsId/detail"}
render={ render={
(props) => { (props) => {
return (<OrganizeIndex {...props} {...this.props} {...this.state} />) return (<OpsDetail {...this.props} {...props} {...this.state} />)
}
}>
</Route> */}
{/* 个人主页 */}
<Route path="/:username"
render={
(props) => {
return (<InfosIndex {...this.props} {...this.state} />)
}
}></Route>
<Route exact path="/"
render={
(props) => (
personal && personal.length > 0 ?
<InfosIndex {...this.props} {...props} />
:
<ProjectIndex {...this.props} {...props} />
)
} }
/> }>
<Route component={Shixunnopage} /> </Route>
</Switch> <Route
</Router> path={"/settings"}
render={
(props) => {
return (<Security {...this.props} {...props} {...this.state} />)
}
}>
</Route>
{/*项目*/}
<Route
path={"/projects"}
render={
(props) => {
return (<Projects {...this.props} {...props} {...this.state} />)
}
}>
</Route>
<Route
path="/register"
render={
(props) => {
return (<EducoderLogin {...this.props} {...props} {...this.state} />)
}
}
/>
{/*403*/}
<Route path="/403" component={Shixunauthority} />
<Route path="/500" component={http500} />
{/*404*/}
<Route path="/nopage" component={Shixunnopage} />
{/* 查询 */}
<Route path="/search" component={Search} />
<Route exact path="/explore"
render={
(props) => (
personal && personal.length > 0 ?
<InfosIndex {...this.props} {...props} />
:
<ProjectIndex {...this.props} {...props} />
)
}
/>
{/* 判断为用户/组织,并进入对应页面 */}
{
pathType === 'User' ?
<Route exact path="/:username"
render={
(props) => {
return (<InfosIndex {...this.props} {...this.state} />)
}
}
/> : pathType === 'Organization' ? <Route path={"/:OIdentifier"}
render={
(props) => {
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
}
}>
</Route> : pathType === '404' ? <Route path="/nopage" component={Shixunnopage} /> : <Route exact path="/"
render={
(props) => (
personal && personal.length > 0 ?
<InfosIndex {...this.props} {...props} />
:
<ProjectIndex {...this.props} {...props} />
)
}
/>
}
{/* 组织 */}
<Route path={"/organize"}
render={
(props) => {
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
}
}>
</Route>
{/* 个人主页 */}
<Route path="/:username"
render={
(props) => {
return (<InfosIndex {...this.props} {...this.state} />)
}
}></Route>
<Route component={Shixunnopage} />
</Switch>
{/* </Router> */}
</MuiThemeProvider> </MuiThemeProvider>
</ConfigProvider> </ConfigProvider>
</Provider> </Provider>

View File

@ -195,7 +195,7 @@ class College extends Component {
align: 'center', align: 'center',
className: "edu-txt-center font-14 maxnamewidth105", className: "edu-txt-center font-14 maxnamewidth105",
render: (text, record) => ( render: (text, record) => (
<a href={`/users/${record.login}`} title={record.name} target="_blank" className="task-hide maxnamewidth105" style={{ <a href={`/${record.login}`} title={record.name} target="_blank" className="task-hide maxnamewidth105" style={{
color:'#007bff', color:'#007bff',
}}> { }}> {

View File

@ -435,11 +435,11 @@ class TPIContextProvider extends Component {
image_url: "avatars/User/1" image_url: "avatars/User/1"
login: "innov" login: "innov"
name: "Coder" name: "Coder"
user_url: "/users/innov" user_url: "/innov"
*/ */
let user = resData.user; let user = resData.user;
user.username = resData.user.name; user.username = resData.user.name;
user.user_url = `/users/${resData.user.login}`; user.user_url = `/${resData.user.login}`;
// user.image_url = resData.image_url; // user.image_url = resData.image_url;
user.is_teacher = resData.is_teacher; user.is_teacher = resData.is_teacher;
resData.user = user; resData.user = user;

View File

@ -32,7 +32,7 @@ class ActivityItem extends Component {
</p > </p >
} }
<p className="itemLine mt10"> <p className="itemLine mt10">
<Link to={`/users/${item && item.user_login}`} className="show-user-link"> <Link to={`/${item && item.user_login}`} className="show-user-link">
<img alt="" src={getImageUrl(`/${item.user_avatar}`)} className="createImage" /> <img alt="" src={getImageUrl(`/${item.user_avatar}`)} className="createImage" />
<span className="mr20">{item.user_name}</span> <span className="mr20">{item.user_name}</span>
</Link> </Link>

View File

@ -52,8 +52,8 @@ function Contributors({contributors,owner,projectsId}){
<Spin spinning={isSpin}> <Spin spinning={isSpin}>
<FlexAJ> <FlexAJ>
<AlignCenter> <AlignCenter>
<Link to={`/users/${data.login}`}><img src={getImageUrl(`/${data.image_url}`)} alt="" className="radius" width="38px" height="38px"/></Link> <Link to={`/${data.login}`}><img src={getImageUrl(`/${data.image_url}`)} alt="" className="radius" width="38px" height="38px"/></Link>
<Link to={`/users/${data.login}`} className="ml10">{data.name}</Link> <Link to={`/${data.login}`} className="ml10">{data.name}</Link>
</AlignCenter> </AlignCenter>
{ {
data.is_watch ? <a className="color-grey-9" onClick={()=>FocusFunc(false,data.login)}>取消关注</a>:<a className="color-blue" onClick={()=>FocusFunc(true,data.login)}>关注</a> data.is_watch ? <a className="color-grey-9" onClick={()=>FocusFunc(false,data.login)}>取消关注</a>:<a className="color-blue" onClick={()=>FocusFunc(true,data.login)}>关注</a>
@ -145,7 +145,7 @@ function Contributors({contributors,owner,projectsId}){
list.map((item,key)=>{ list.map((item,key)=>{
return( return(
<Popover content={menu} visible={item.visible} overlayClassName="menuPanels" placement="top"> <Popover content={menu} visible={item.visible} overlayClassName="menuPanels" placement="top">
<Link key={key} to={`/users/${item.login}`}> <Link key={key} to={`/${item.login}`}>
<img src={getImageUrl(`/${item.image_url}`)} alt="" onMouseOver={()=>setVisibleFunc(true,item.login,key)}/> <img src={getImageUrl(`/${item.image_url}`)} alt="" onMouseOver={()=>setVisibleFunc(true,item.login,key)}/>
</Link> </Link>
</Popover> </Popover>

View File

@ -45,9 +45,9 @@ const Div = styled.div`{
export default (({ user , img, name, time, focusStatus, is_current_user, login , successFunc }) => { export default (({ user , img, name, time, focusStatus, is_current_user, login , successFunc }) => {
return ( return (
<Div> <Div>
<Link to={`/users/${user && user.login}`}><Img src={getImageUrl(`/${img}`)} /></Link> <Link to={`/${user && user.login}`}><Img src={getImageUrl(`/${img}`)} /></Link>
<div className="m-infos"> <div className="m-infos">
<Link to={`/users/${user && user.login}`}><Name>{name}</Name></Link> <Link to={`/${user && user.login}`}><Name>{name}</Name></Link>
<Time><I className="iconfont icon-shijian"></I>加入时间:{time}</Time> <Time><I className="iconfont icon-shijian"></I>加入时间:{time}</Time>
{ {
is_current_user ? is_current_user ?

View File

@ -20,7 +20,7 @@ export default ({ url , name , column , id , login })=>{
`; `;
return( return(
id? id?
<Link to={`/users/${login}`}> <Link to={`/${login}`}>
<Img> <Img>
{ url && <img src={url} alt=""/> } { url && <img src={url} alt=""/> }
<span>{name}</span> <span>{name}</span>

View File

@ -385,16 +385,16 @@ class NewHeader extends Component {
if (new_link && (new_link.indexOf("courses") > -1 || new_link.indexOf("contests") > -1)) { if (new_link && (new_link.indexOf("courses") > -1 || new_link.indexOf("contests") > -1)) {
if (user_login) { if (user_login) {
if (new_link.indexOf("courses") > -1) { if (new_link.indexOf("courses") > -1) {
new_link = new_link.replace(/courses/g, "users/" + user_login + "/courses") new_link = new_link.replace(/courses/g, user_login + "/courses")
} else if (new_link.indexOf("contests") > -1) { } else if (new_link.indexOf("contests") > -1) {
new_link = new_link.replace(/contests/g, "users/" + user_login + "/contests") new_link = new_link.replace(/contests/g, user_login + "/contests")
} }
} else { } else {
is_hidden = true is_hidden = true
} }
} }
if (user_login && (new_link && new_link.indexOf("homes") > -1)) { if (user_login && (new_link && new_link.indexOf("homes") > -1)) {
new_link = new_link.replace(/homes/g, "users/" + user_login + "/user_activities") new_link = new_link.replace(/homes/g, user_login + "/user_activities")
} }
var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) ); var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) );
@ -442,7 +442,7 @@ class NewHeader extends Component {
</span> </span>
: :
<Dropdown placement={`bottomRight`} overlay={this.renderMenu(settings && settings.personal)}> <Dropdown placement={`bottomRight`} overlay={this.renderMenu(settings && settings.personal)}>
<a href={`/users/${this.props.current_user && this.props.current_user.login}`}> <a href={`/${this.props.current_user && this.props.current_user.login}`}>
<img alt="头像" src={getImageUrl(`/${user.image_url}`)} className="currentImg"></img> <img alt="头像" src={getImageUrl(`/${user.image_url}`)} className="currentImg"></img>
</a> </a>
</Dropdown> </Dropdown>

View File

@ -147,7 +147,7 @@ class CoderRootCommit extends Component{
<p className="f-wrap-alignCenter mt15"> <p className="f-wrap-alignCenter mt15">
{ {
item.id ? item.id ?
<Link to={`/users/${item.login}`} className="show-user-link"> <Link to={`/${item.login}`} className="show-user-link">
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""} {item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label> <label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label>
</Link>: </Link>:

View File

@ -413,11 +413,10 @@ class Detail extends Component {
} }
textFunc = (forked_from_project_id,fork_info)=>{ textFunc = (forked_from_project_id,fork_info)=>{
let type = fork_info && fork_info.fork_project_user_type;
return forked_from_project_id && fork_info ? return forked_from_project_id && fork_info ?
<div className="color-grey-9 df"> <div className="color-grey-9 df">
<span>复刻自</span> <span>复刻自</span>
<Link to={`${type ==="Organization" ? '':'/users'}/${fork_info.fork_project_user_login}`} className="show-user-link color-grey-6 ml5">{fork_info.fork_project_user_name}</Link> <Link to={`/${fork_info.fork_project_user_login}`} className="show-user-link color-grey-6 ml5">{fork_info.fork_project_user_name}</Link>
<span> / </span> <span> / </span>
<Link to={`/projects/${fork_info.fork_project_user_login}/${fork_info.fork_project_identifier}`} className="color-grey-6 task-hide flex1" style={{maxWidth:"400px"}} title={fork_info.fork_form_name}>{fork_info.fork_form_name}</Link> <Link to={`/projects/${fork_info.fork_project_user_login}/${fork_info.fork_project_identifier}`} className="color-grey-6 task-hide flex1" style={{maxWidth:"400px"}} title={fork_info.fork_form_name}>{fork_info.fork_form_name}</Link>
</div> : "" </div> : ""
@ -453,7 +452,7 @@ class Detail extends Component {
<AlignTop> <AlignTop>
<div className="projectallName"> <div className="projectallName">
{project && project.author && {project && project.author &&
<Link to={`${project.author.type ==="Organization" ? '':'/users'}/${project.author.login}`}>{project.author.name}</Link> <Link to={`/${project.author.login}`}>{project.author.name}</Link>
} }
<span className="ml5 mr5">/</span> <span className="ml5 mr5">/</span>
<Link to={`/projects/${owner}/${projectsId}`} className="projectN mt6">{projectDetail && projectDetail.name}</Link> <Link to={`/projects/${owner}/${projectsId}`} className="projectN mt6">{projectDetail && projectDetail.name}</Link>

View File

@ -28,7 +28,7 @@ class IndexItem extends Component {
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img> <img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
</a> </a>
: :
<Link to={item.author && (item.author.type === "Organization" ? `/${item.author.login}`:`/users/${item.author.login}`)} className="show-user-link"> <Link to={item.author && item.author.login} className="show-user-link">
<img className="p-r-photo" alt="" src={getImageUrl(`/${item.author && item.author.image_url}`)} ></img> <img className="p-r-photo" alt="" src={getImageUrl(`/${item.author && item.author.image_url}`)} ></img>
</Link> </Link>
} }

View File

@ -52,7 +52,7 @@ function Contribute(props){
<AlignCenter> <AlignCenter>
<img alt="" style={{borderRadius:"50%",marginRight:"10px"}} src={getImageUrl(`/${item.image_url}`)} width="50px" height="50px"/> <img alt="" style={{borderRadius:"50%",marginRight:"10px"}} src={getImageUrl(`/${item.image_url}`)} width="50px" height="50px"/>
<div> <div>
<Link to={`/users/${item.login}`} className="font-16">{item.name}</Link> <Link to={`/${item.login}`} className="font-16">{item.name}</Link>
<p className="font-12 color-grey-9">提交{item.contributions}</p> <p className="font-12 color-grey-9">提交{item.contributions}</p>
</div> </div>
</AlignCenter> </AlignCenter>

View File

@ -78,7 +78,7 @@ class MergeItem extends Component {
</p> </p>
<p className="grid-item font-13"> <p className="grid-item font-13">
<Link <Link
to={`/users/${item && item.author_login}`} to={`/${item && item.author_login}`}
className="show-user-link" className="show-user-link"
> >
<img <img
@ -91,7 +91,7 @@ class MergeItem extends Component {
</Link> </Link>
<AlignCenter> <AlignCenter>
<Link <Link
to={`/users/${item && item.author_login}`} to={`/${item && item.author_login}`}
className="show-user-link color-grey-8 ml5" className="show-user-link color-grey-8 ml5"
> >
{item && item.author_name} {item && item.author_name}
@ -156,7 +156,7 @@ class MergeItem extends Component {
<li> <li>
{item.assign_user_name ? ( {item.assign_user_name ? (
<Link <Link
to={`/users/${item.assign_user_login}`} to={`/${item.assign_user_login}`}
className="show-user-link" className="show-user-link"
> >
{item.assign_user_name} {item.assign_user_name}

View File

@ -100,7 +100,7 @@ class MergeSubmit extends Component{
width:"10%", width:"10%",
render: (text,item) => ( render: (text,item) => (
<span className="f-wrap-alignCenter"> <span className="f-wrap-alignCenter">
<Link to={`/users/${item.login}`} className="show-user-link"> <Link to={`/${item.login}`} className="show-user-link">
<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr3 radius"/> <img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr3 radius"/>
<label className="hide-1" style={{maxWidth:"75px",'vertical-align':'middle'}}>{text}</label> <label className="hide-1" style={{maxWidth:"75px",'vertical-align':'middle'}}>{text}</label>
</Link> </Link>

View File

@ -386,14 +386,14 @@ class MessageCount extends Component {
} }
<div className="mt15"> <div className="mt15">
<Link to={`/users/${data.issue.author_login}`} className="show-user-link"> <Link to={`/${data.issue.author_login}`} className="show-user-link">
<img className="mr5" src={getImageUrl(`/${data.issue.author_picture}`)} <img className="mr5" src={getImageUrl(`/${data.issue.author_picture}`)}
alt="" width="24" height="24" style={{borderRadius:"50%"}} alt="" width="24" height="24" style={{borderRadius:"50%"}}
/> />
</Link> </Link>
<span className="ver-middle"> <span className="ver-middle">
<span className="color-grey-8 mr5"></span> <span className="color-grey-8 mr5"></span>
<Link to={`/users/${data.issue.author_login}`} className="show-user-link color-blue"> <Link to={`/${data.issue.author_login}`} className="show-user-link color-blue">
{data.issue.author_name} {data.issue.author_name}
</Link> </Link>
<span className="ml5 color-grey-8"> <span className="ml5 color-grey-8">
@ -408,7 +408,7 @@ class MessageCount extends Component {
<span className="color-grey-8">审查人员</span> <span className="color-grey-8">审查人员</span>
{data.issue.assign_user_name ? ( {data.issue.assign_user_name ? (
<Link <Link
to={`/users/${data.issue.assign_user_login}`} to={`/${data.issue.assign_user_login}`}
className="show-user-link color-blue" className="show-user-link color-blue"
> >
{data.issue.assign_user_name} {data.issue.assign_user_name}

View File

@ -150,7 +150,7 @@ class UserSubmitComponent extends Component {
return ( return (
<div> <div>
<span className="df" style={{ alignItems: "center" }}> <span className="df" style={{ alignItems: "center" }}>
<Link to={`/users/${current_user && current_user.login}`} className="show-user-link" > <Link to={`/${current_user && current_user.login}`} className="show-user-link" >
<img <img
src={getImageUrl(`/${current_user && current_user.image_url}`)} src={getImageUrl(`/${current_user && current_user.image_url}`)}
alt="" alt=""

View File

@ -63,11 +63,11 @@ function Apply(props) {
{ {
list.map((i,k)=>{ list.map((i,k)=>{
return( return(
<li> <li key={k}>
<Link to={`/users/${i.user && i.user.login}`}><img src={getImageUrl(`/${i.user && i.user.image_url}`)} alt="" className="notifyImg"/></Link> <Link to={`/${i.user && i.user.login}`}><img src={getImageUrl(`/${i.user && i.user.image_url}`)} alt="" className="notifyImg"/></Link>
<div className="notifyFlex"> <div className="notifyFlex">
<p className="notifyInfos"> <p className="notifyInfos">
<Link to={`/users/${i.user && i.user.login}`} className="font-15 mr20">{i.user && i.user.name}</Link> <Link to={`/${i.user && i.user.login}`} className="font-15 mr20">{i.user && i.user.name}</Link>
<span className="color-grey-9">{i.time_ago}</span> <span className="color-grey-9">{i.time_ago}</span>
</p> </p>
<FlexAJ> <FlexAJ>

View File

@ -33,7 +33,7 @@ function Index(props){
useEffect(()=>{ useEffect(()=>{
if((username && current_user && (current_user.login !== username))){ if((username && current_user && (current_user.login !== username))){
props.history.push(`/users/${username}`); props.history.push(`/${username}`);
} }
},[current_user,username]) },[current_user,username])
@ -47,14 +47,14 @@ function Index(props){
useEffect(()=>{ useEffect(()=>{
if(pathname && username){ if(pathname && username){
if(pathname === `/users/${username}/notice`){ if(pathname === `/${username}/notice`){
setMenu("notify"); setMenu("notify");
changeNum(user.undo_messages); changeNum(user.undo_messages);
} }
if(pathname === `/users/${username}/notice/undo`){ if(pathname === `/${username}/notice/undo`){
setMenu("undo"); setMenu("undo");
} }
if(pathname === `/users/${username}/notice/apply`){ if(pathname === `/${username}/notice/apply`){
setMenu("apply"); setMenu("apply");
} }
} }
@ -84,19 +84,19 @@ function Index(props){
<div> <div>
<ul className="noticeMenu"> <ul className="noticeMenu">
<li className={menu === "notify" ? "active":""}> <li className={menu === "notify" ? "active":""}>
<Link to={`/users/${username}/notice`} onClick={changeNum}> <Link to={`/${username}/notice`} onClick={changeNum}>
<span>通知</span> <span>通知</span>
{messagesCount ? <span className="unNum">{messagesCount}</span>:""} {messagesCount ? <span className="unNum">{messagesCount}</span>:""}
</Link> </Link>
</li> </li>
<li className={menu === "undo" ? "active":""}> <li className={menu === "undo" ? "active":""}>
<Link to={`/users/${username}/notice/undo`}> <Link to={`/${username}/notice/undo`}>
<span>接收仓库</span> <span>接收仓库</span>
{transferCount ? <span className="unNum">{transferCount}</span>:""} {transferCount ? <span className="unNum">{transferCount}</span>:""}
</Link> </Link>
</li> </li>
<li className={menu === "apply" ? "active":""}> <li className={menu === "apply" ? "active":""}>
<Link to={`/users/${username}/notice/apply`}> <Link to={`/${username}/notice/apply`}>
<span>成员申请</span> <span>成员申请</span>
{applyCount ? <span className="unNum">{applyCount}</span>:""} {applyCount ? <span className="unNum">{applyCount}</span>:""}
</Link> </Link>
@ -104,19 +104,19 @@ function Index(props){
</ul> </ul>
<Switch> <Switch>
<Route <Route
path="/users/:username/notice/apply" path="/:username/notice/apply"
render={(p) => { render={(p) => {
return <Apply {...props} {...p} deleteEvent={deleteEvent}/>; return <Apply {...props} {...p} deleteEvent={deleteEvent}/>;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username/notice/undo" path="/:username/notice/undo"
render={(p) => { render={(p) => {
return <UndoEvent {...props} {...p} deleteEvent={deleteEvent}/>; return <UndoEvent {...props} {...p} deleteEvent={deleteEvent}/>;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username/notice" path="/:username/notice"
render={(p) => { render={(p) => {
return <Notify {...props} {...p} deleteEvent={deleteEvent}/>; return <Notify {...props} {...p} deleteEvent={deleteEvent}/>;
}} }}

View File

@ -46,9 +46,9 @@ function Notify(props){
case 'canceled': case 'canceled':
return <p>取消转移<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>仓库</p> return <p>取消转移<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>仓库</p>
case 'common': case 'common':
return <p>正在将<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>仓库转移给<Link to={`/users/${owner && owner.login}`}>{owner && owner.name}</Link></p> return <p>正在将<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>仓库转移给<Link to={`/${owner && owner.login}`}>{owner && owner.name}</Link></p>
case 'successed': case 'successed':
return <p><Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>仓库成功转移给<Link to={`/users/${owner && owner.login}`}>{owner && owner.name}</Link></p> return <p><Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>仓库成功转移给<Link to={`/${owner && owner.login}`}>{owner && owner.name}</Link></p>
default: default:
return <p>拒绝转移<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>仓库</p> return <p>拒绝转移<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>仓库</p>
} }
@ -81,11 +81,11 @@ function Notify(props){
{ {
list.map((i,k)=>{ list.map((i,k)=>{
return( return(
<li> <li i={k}>
<Link to={`/users/${i.login}`}><img src={getImageUrl(`/${i.applied_user && i.applied_user.image_url}`)} alt="" className="notifyImg"/></Link> <Link to={`/${i.login}`}><img src={getImageUrl(`/${i.applied_user && i.applied_user.image_url}`)} alt="" className="notifyImg"/></Link>
<div className="notifyFlex"> <div className="notifyFlex">
<p className="notifyInfos"> <p className="notifyInfos">
<Link to={`/users/${i.applied_user && i.applied_user.login}`} className="font-15 mr20">{i.applied_user && i.applied_user.name}</Link> <Link to={`/${i.applied_user && i.applied_user.login}`} className="font-15 mr20">{i.applied_user && i.applied_user.name}</Link>
<span className="color-grey-9">{i.time_ago}</span> <span className="color-grey-9">{i.time_ago}</span>
</p> </p>
{ i.applied_type === "AppliedProject" ? renderApplyStatus(i.status,i.applied):renderStatus(i.status,i.applied)} { i.applied_type === "AppliedProject" ? renderApplyStatus(i.status,i.applied):renderStatus(i.status,i.applied)}

View File

@ -68,16 +68,16 @@ function UndoEvent(props){
{ {
list.map((i,k)=>{ list.map((i,k)=>{
return( return(
<li> <li key={k}>
<Link to={`/users/${i.user && i.user.login}`}><img src={getImageUrl(`/${i.user && i.user.image_url}`)} alt="" className="notifyImg"/></Link> <Link to={`/${i.user && i.user.login}`}><img src={getImageUrl(`/${i.user && i.user.image_url}`)} alt="" className="notifyImg"/></Link>
<div className="notifyFlex"> <div className="notifyFlex">
<p className="notifyInfos"> <p className="notifyInfos">
<Link to={`/users/${i.login}`} className="font-15 mr20">{i.user && i.user.name}</Link> <Link to={`/${i.login}`} className="font-15 mr20">{i.user && i.user.name}</Link>
<span className="color-grey-9">{i.time_ago}</span> <span className="color-grey-9">{i.time_ago}</span>
</p> </p>
<FlexAJ> <FlexAJ>
<p className="color-grey-6">请求将仓库<Link to={`/projects/${i.project && i.project.owner && i.project.owner.login}/${i.project && i.project.identifier}`}>{i.project && i.project.name}</Link> <p className="color-grey-6">请求将仓库<Link to={`/projects/${i.project && i.project.owner && i.project.owner.login}/${i.project && i.project.identifier}`}>{i.project && i.project.name}</Link>
转移给<Link to={`/users/${i.owner && i.owner.login}`}>{i.owner && i.owner.name}</Link>是否接受</p> 转移给<Link to={`/${i.owner && i.owner.login}`}>{i.owner && i.owner.name}</Link>是否接受</p>
{ {
i.status === "common" && i.status === "common" &&
<span> <span>

View File

@ -207,7 +207,7 @@ class Detail extends Component {
<div className="background-f boder-4"> <div className="background-f boder-4">
<div className="grid-item border-1f pd20 "> <div className="grid-item border-1f pd20 ">
<Link <Link
to={`/users/${data && data.author_login}`} to={`/${data && data.author_login}`}
className="show-user-link" className="show-user-link"
> >
<img <img
@ -240,7 +240,7 @@ class Detail extends Component {
<div className="mt10"> <div className="mt10">
<span className="color-grey-9 mr5"></span> <span className="color-grey-9 mr5"></span>
<Link <Link
to={`/users/${data && data.author_login}`} to={`/${data && data.author_login}`}
className="show-user-link color-blue" className="show-user-link color-blue"
> >
{data && data.author_name} {data && data.author_name}

View File

@ -67,7 +67,7 @@ class OrderItem extends Component {
<li> <li>
{ {
item.author_name ? item.author_name ?
<Link to={`/users/${item.author_login}`} className="show-user-link"> <Link to={`/${item.author_login}`} className="show-user-link">
{item.author_name} {item.author_name}
</Link> </Link>
: "--" : "--"
@ -76,7 +76,7 @@ class OrderItem extends Component {
<li> <li>
{ {
item.assign_user_name ? item.assign_user_name ?
<Link to={`/users/${item.assign_user_login}`} className="show-user-link"> <Link to={`/${item.assign_user_login}`} className="show-user-link">
{item.assign_user_name} {item.assign_user_name}
</Link> </Link>
: "--" : "--"

View File

@ -186,7 +186,7 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
render: (text, item) => ( render: (text, item) => (
<span className="f-wrap-alignCenter"> <span className="f-wrap-alignCenter">
<Link <Link
to={`/users/${item.login}`} to={`/${item.login}`}
className="show-user-link" className="show-user-link"
> >
<img <img
@ -204,7 +204,7 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
title: "用户名", title: "用户名",
dataIndex: "name", dataIndex: "name",
render: (text, item) => ( render: (text, item) => (
<Link to={`/users/${item.login}`} className="show-user-link"> <Link to={`/${item.login}`} className="show-user-link">
{text} {text}
</Link> </Link>
), ),

View File

@ -351,7 +351,7 @@ class Setting extends Component {
{ {
is_transfering ? is_transfering ?
<span>此仓库正在转移给 <span>此仓库正在转移给
{transfer && <Link to={transfer.type="User"?`/users/${transfer.login}`:`/organize/${transfer.login}`}>{transfer.name}</Link>} {transfer && <Link to={transfer.login}>{transfer.name}</Link>}
请联系对方接收此仓库</span> 请联系对方接收此仓库</span>
: :
`将此仓库转移给其他用户或组织` `将此仓库转移给其他用户或组织`

View File

@ -217,7 +217,7 @@ function Index(props){
data.map((item,key)=>{ data.map((item,key)=>{
return( return(
<li> <li>
<Link to= {`/users/${item.login}`} className="infoImg"><img src={getImageUrl(`/${item.imageUrl}`)} alt="" /></Link> <Link to= {`/${item.login}`} className="infoImg"><img src={getImageUrl(`/${item.imageUrl}`)} alt="" /></Link>
<div style={{flex:'1',width:"0"}}> <div style={{flex:'1',width:"0"}}>
<FlexAJ> <FlexAJ>
<AlignCenter> <AlignCenter>

View File

@ -87,7 +87,7 @@ export default ((props) => {
align: "center", align: "center",
render: (value, item) => { render: (value, item) => {
return ( return (
<Link to={`/users/${item.user.login}`}>{item.user.name}</Link> <Link to={`/${item.user.login}`}>{item.user.name}</Link>
) )
} }
}, },

View File

@ -56,6 +56,10 @@ export default Form.create()(
}) })
} }
function test(){
history.push(`/test2org`);
}
useEffect(()=>{ useEffect(()=>{
setFieldsValue({ setFieldsValue({
visibility:"common" visibility:"common"
@ -145,6 +149,7 @@ export default Form.create()(
<p className="mt20"> <p className="mt20">
<Button type="primary" className="mr30" onClick={createOrganize}>创建组织</Button> <Button type="primary" className="mr30" onClick={createOrganize}>创建组织</Button>
<Button className="grey" onClick={()=>{window.history.back(-1)}}>取消</Button> <Button className="grey" onClick={()=>{window.history.back(-1)}}>取消</Button>
<Button className="grey" onClick={test}>test</Button>
</p> </p>
</div> </div>
) )

View File

@ -72,9 +72,9 @@ function RightBox({ OIdentifier , history , admin }) {
memberData.organization_users.map((item,key)=>{ memberData.organization_users.map((item,key)=>{
return( return(
<div className="teammembers" key={key}> <div className="teammembers" key={key}>
<Link to={`/users/${item.user && item.user.login}`}><Img src={getImageUrl(`/${item.user && item.user.image_url}`)} alt="" className="m-img"/></Link> <Link to={`/${item.user && item.user.login}`}><Img src={getImageUrl(`/${item.user && item.user.image_url}`)} alt="" className="m-img"/></Link>
<div> <div>
<Link to={`/users/${item.user && item.user.login}`}><ListName>{item.user && item.user.name}</ListName></Link> <Link to={`/${item.user && item.user.login}`}><ListName>{item.user && item.user.name}</ListName></Link>
<Align><i className="iconfont icon-shijian color-green mr3 font-13"></i><Span>加入时间{item.created_at}</Span></Align> <Align><i className="iconfont icon-shijian color-green mr3 font-13"></i><Span>加入时间{item.created_at}</Span></Align>
</div> </div>
</div> </div>

View File

@ -92,7 +92,7 @@ export default Form.create()(
}).then(result=>{ }).then(result=>{
if(result && result.data){ if(result && result.data){
// //
history.push(`/users/${current_user && current_user.login}/organizes`); history.push(`/${current_user && current_user.login}/organizes`);
} }
}) })
setVisible(false); setVisible(false);

View File

@ -64,7 +64,7 @@ export default (({organizeDetail})=>{
width:"5%", width:"5%",
render:(value)=>{ render:(value)=>{
return( return(
value && <Link to={`/users/${value && value.login}`}><Img src={getImageUrl('/'+value.image_url)}></Img> </Link> value && <Link to={`/${value && value.login}`}><Img src={getImageUrl('/'+value.image_url)}></Img> </Link>
) )
} }
}, },
@ -73,7 +73,7 @@ export default (({organizeDetail})=>{
dataIndex: 'user', dataIndex: 'user',
width:"15%", width:"15%",
render:(value,item)=>{ render:(value,item)=>{
return <Link to={`/users/${value && value.login}`}>{value && value.name}</Link> return <Link to={`/${value && value.login}`}>{value && value.name}</Link>
} }
}, },
{ {

View File

@ -86,7 +86,7 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
{ {
item.users && item.users.map((i,k)=>{ item.users && item.users.map((i,k)=>{
return( return(
k < count ? <Link to={`/users/${i.login}`}><ImgContent title={i.name} key={k} src={getImageUrl(`/${i.image_url}`)}/></Link> k < count ? <Link to={`/${i.login}`}><ImgContent title={i.name} key={k} src={getImageUrl(`/${i.image_url}`)}/></Link>
: :
k === count ? k === count ?
<Link to={`/${organizeDetail && organizeDetail.name}/group/${item.id}`} className="moreMember" title="查看更多" ><i className="iconfont icon-zhunbeizhong"></i></Link> <Link to={`/${organizeDetail && organizeDetail.name}/group/${item.id}`} className="moreMember" title="查看更多" ><i className="iconfont icon-zhunbeizhong"></i></Link>

View File

@ -83,7 +83,7 @@ class ForkUsers extends Component {
<div className="pbt25 grid-item mlr10 border-b-line"> <div className="pbt25 grid-item mlr10 border-b-line">
<div> <div>
<Link <Link
to={`/users/${item.login}`} to={`/${item.login}`}
className="show-user-link" className="show-user-link"
> >
<img <img

View File

@ -14,7 +14,7 @@ class UserList extends Component {
<div className="pbt25 grid-item mlr10 border-b-line"> <div className="pbt25 grid-item mlr10 border-b-line">
<div> <div>
<a <a
href={`/users/${item.login}`} href={`/${item.login}`}
className="show-user-link" className="show-user-link"
> >
<img <img
@ -27,7 +27,7 @@ class UserList extends Component {
<div className="ml12"> <div className="ml12">
<div> <div>
<Link <Link
to={`/users/${item.login}`} to={`/${item.login}`}
className="font-16 text-primary task-hide max-w-200" className="font-16 text-primary task-hide max-w-200"
style={{display:"block"}} style={{display:"block"}}
title={item.name} title={item.name}

View File

@ -106,7 +106,7 @@ export default (props) => {
function goUser(login) { function goUser(login) {
window.location.href = `/users/${login}`; window.location.href = `/${login}`;
} }
// //

View File

@ -113,7 +113,7 @@ class children_comments extends Component {
<div className="width100"> <div className="width100">
<div className="grid-item pb5"> <div className="grid-item pb5">
<Link <Link
to={`/users/${item && item.user_login}`} to={`/${item && item.user_login}`}
className="show-user-link" className="show-user-link"
> >
<img <img
@ -125,7 +125,7 @@ class children_comments extends Component {
/> />
</Link> </Link>
<Link <Link
to={`/users/${item && item.user_login}`} to={`/${item && item.user_login}`}
className="show-user-link color-black ml10 fwb" className="show-user-link color-black ml10 fwb"
> >
{item && item.user_name} {item && item.user_name}

View File

@ -77,7 +77,7 @@ class children_journals extends Component {
<div className="width100"> <div className="width100">
<div className="grid-item pb10"> <div className="grid-item pb10">
<Link <Link
to={`/users/${item && item.user_login}`} to={`/${item && item.user_login}`}
className="show-user-link" className="show-user-link"
> >
<img <img
@ -91,7 +91,7 @@ class children_journals extends Component {
<span className="grid-item"> <span className="grid-item">
<span> <span>
<Link <Link
to={`/users/${item && item.user_login}`} to={`/${item && item.user_login}`}
className="show-user-link color-blue ml10" className="show-user-link color-blue ml10"
> >
{item && item.user_name} {item && item.user_name}

View File

@ -304,7 +304,7 @@ class comments extends Component {
return ( return (
<div className="grid-item-top pb10"> <div className="grid-item-top pb10">
<Link <Link
to={`/users/${current_user && current_user.login}`} to={`/${current_user && current_user.login}`}
className="show-user-link mr10" className="show-user-link mr10"
> >
<img <img
@ -370,7 +370,7 @@ class comments extends Component {
<div className="width100"> <div className="width100">
<div className="pb5"> <div className="pb5">
<Link <Link
to={`/users/${item && item.user_login}`} to={`/${item && item.user_login}`}
className="show-user-link" className="show-user-link"
> >
<img <img
@ -382,7 +382,7 @@ class comments extends Component {
/> />
</Link> </Link>
<Link <Link
to={`/users/${item && item.user_login}`} to={`/${item && item.user_login}`}
className="show-user-link color-black ml10 fwb" className="show-user-link color-black ml10 fwb"
> >
{item && item.user_name} {item && item.user_name}

View File

@ -58,7 +58,7 @@ function ConcentrateProject({userLogin,current}) {
{ {
list.map((i,k)=>{ list.map((i,k)=>{
return( return(
<li> <li key={i.id}>
<Link to={`/projects/${i.author && i.author.login}/${i.identifier}`} className="name">{i.name}</Link> <Link to={`/projects/${i.author && i.author.login}/${i.identifier}`} className="name">{i.name}</Link>
<p className="task-hide desc">{i.description}</p> <p className="task-hide desc">{i.description}</p>
<AlignCenter> <AlignCenter>

View File

@ -12,9 +12,7 @@ const Infos = Loadable({
}); });
export default withRouter( export default withRouter(
(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props)=>{ (CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props)=>{
console.log(props);
return( return(
<div>
<Switch> <Switch>
<Route <Route
path="/:username" path="/:username"
@ -23,7 +21,6 @@ export default withRouter(
)} )}
></Route> ></Route>
</Switch> </Switch>
</div>
) )
})))) }))))
) )

View File

@ -72,22 +72,21 @@ class Infos extends Component {
renderPath=(pathname)=>{ renderPath=(pathname)=>{
const { username } = this.props.match.params; const { username } = this.props.match.params;
console.log(username); if(pathname === `/${username}`){
if(pathname === `/users/${username}`){
this.setState({menuKey:"0",route_type:undefined}); this.setState({menuKey:"0",route_type:undefined});
}else if(pathname === `/users/${username}/statistics`){ }else if(pathname === `/${username}/statistics`){
this.setState({menuKey:"1",route_type:undefined}); this.setState({menuKey:"1",route_type:undefined});
}else if(pathname.indexOf(`/users/${username}/projects`)>-1){ }else if(pathname.indexOf(`/${username}/projects`)>-1){
this.setState({menuKey:"2",route_type:undefined}); this.setState({menuKey:"2",route_type:undefined});
}else if(pathname.indexOf(`/users/${username}/notice`)>-1){ }else if(pathname.indexOf(`/${username}/notice`)>-1){
this.setState({menuKey:"3",route_type:undefined}); this.setState({menuKey:"3",route_type:undefined});
}else if(pathname.indexOf(`/users/${username}/devops`)>-1){ }else if(pathname.indexOf(`/${username}/devops`)>-1){
this.setState({menuKey:"4",route_type:undefined}); this.setState({menuKey:"4",route_type:undefined});
}else if(pathname === `/users/${username}/organizes`){ }else if(pathname === `/${username}/organizes`){
this.setState({menuKey:"5",route_type:undefined}); this.setState({menuKey:"5",route_type:undefined});
}else if(pathname === `/users/${username}/watchers`){ }else if(pathname === `/${username}/watchers`){
this.setState({menuKey:undefined,route_type:"watchers"}); this.setState({menuKey:undefined,route_type:"watchers"});
}else if(pathname === `/users/${username}/fan_users`){ }else if(pathname === `/${username}/fan_users`){
this.setState({menuKey:undefined,route_type:"fan_users"}); this.setState({menuKey:undefined,route_type:"fan_users"});
}else{ }else{
this.setState({menuKey:undefined,route_type:undefined}); this.setState({menuKey:undefined,route_type:undefined});
@ -147,7 +146,7 @@ class Infos extends Component {
project_type: type , project_type: type ,
route_type: undefined route_type: undefined
}) })
this.props.history.push(`/users/${user && user.login}/devops/${type}`); this.props.history.push(`/${user && user.login}/devops/${type}`);
} }
undo_link = () => { undo_link = () => {
@ -156,7 +155,7 @@ class Infos extends Component {
route_type: undefined, route_type: undefined,
project_type:"notice", project_type:"notice",
},()=>{ },()=>{
this.props.history.push(`/users/${user && user.login}/notice`); this.props.history.push(`/${user && user.login}/notice`);
this.fetchUser(); this.fetchUser();
}) })
} }
@ -173,7 +172,7 @@ class Infos extends Component {
route_type: undefined, route_type: undefined,
project_type:"organizes" project_type:"organizes"
}) })
this.props.history.push(`/users/${user && user.login}/organizes`) this.props.history.push(`/${user && user.login}/organizes`)
} }
resetUser=()=>{ resetUser=()=>{
@ -250,7 +249,7 @@ class Infos extends Component {
</div> </div>
<div className="focusBox"> <div className="focusBox">
<Link <Link
to={`/users/${user && user.login}/watchers`} to={`/${user && user.login}/watchers`}
className={`with50 text-center pull-left ${route_type === "watchers" ? "text-primary" : ""}`} className={`with50 text-center pull-left ${route_type === "watchers" ? "text-primary" : ""}`}
onClick={() =>this.route_link("watchers")} onClick={() =>this.route_link("watchers")}
> >
@ -258,7 +257,7 @@ class Infos extends Component {
<span>{user && user.watching_count}</span> <span>{user && user.watching_count}</span>
</Link> </Link>
<Link <Link
to={`/users/${user && user.login}/fan_users`} to={`/${user && user.login}/fan_users`}
onClick={() =>this.route_link("fan_users")} onClick={() =>this.route_link("fan_users")}
className={`with50 text-center pull-left ${route_type === "fan_users" ? "text-primary" : ""}`} className={`with50 text-center pull-left ${route_type === "fan_users" ? "text-primary" : ""}`}
> >
@ -281,13 +280,13 @@ class Infos extends Component {
<div className="list-right"> <div className="list-right">
{ !route_type && menuKey && { !route_type && menuKey &&
<Menu selectedKeys={[menuKey]} mode={`horizontal`} className="infosRightMenu"> <Menu selectedKeys={[menuKey]} mode={`horizontal`} className="infosRightMenu">
<Menu.Item key="0"><Link to={`/users/${user && user.login}`}><i className="iconfont icon-gailan"></i></Link></Menu.Item> <Menu.Item key="0"><Link to={`/${user && user.login}`}><i className="iconfont icon-gailan"></i></Link></Menu.Item>
<Menu.Item key="1"><Link to={`/users/${user && user.login}/statistics`}><i className="iconfont icon-shujutongji"></i></Link></Menu.Item> <Menu.Item key="1"><Link to={`/${user && user.login}/statistics`}><i className="iconfont icon-shujutongji"></i></Link></Menu.Item>
<Menu.Item key="2"><Link to={`/users/${user && user.login}/projects/common`}><i className="iconfont icon-xiangmu"></i></Link></Menu.Item> <Menu.Item key="2"><Link to={`/${user && user.login}/projects/common`}><i className="iconfont icon-xiangmu"></i></Link></Menu.Item>
{ {
current_user && user && user.login === current_user.login ? current_user && user && user.login === current_user.login ?
<Menu.Item key="3"> <Menu.Item key="3">
<Link to={`/users/${user && user.login}/notice`}> <Link to={`/${user && user.login}/notice`}>
<i className="iconfont icon-daibanshixiang"></i> <i className="iconfont icon-daibanshixiang"></i>
{undo_events && undo_events >0 ? <span className="menuNum">({undo_events})</span>:""}</Link> {undo_events && undo_events >0 ? <span className="menuNum">({undo_events})</span>:""}</Link>
</Menu.Item> </Menu.Item>
@ -295,11 +294,11 @@ class Infos extends Component {
} }
{ {
current_user && current_user.login && current_user.login === username ? current_user && current_user.login && current_user.login === username ?
<Menu.Item key="4"><Link to={`/users/${user && user.login}/devops/CIService`}><i className="iconfont icon-gongzuoliu1"></i>DevOps</Link></Menu.Item> <Menu.Item key="4"><Link to={`/${user && user.login}/devops/CIService`}><i className="iconfont icon-gongzuoliu1"></i>DevOps</Link></Menu.Item>
:"" :""
} }
<Menu.Item key="5"> <Menu.Item key="5">
<Link to={`/users/${user && user.login}/organizes`}> <Link to={`/${user && user.login}/organizes`}>
<i className="iconfont icon-zuzhi"></i> <i className="iconfont icon-zuzhi"></i>
{ user && user.user_org_count && user.user_org_count > 0 ? <span className="menuNum">({user.user_org_count})</span>:""} { user && user.user_org_count && user.user_org_count > 0 ? <span className="menuNum">({user.user_org_count})</span>:""}
</Link> </Link>
@ -309,68 +308,68 @@ class Infos extends Component {
{user && ( {user && (
<Switch {...this.props}> <Switch {...this.props}>
<Route <Route
path="/users/:username/watchers" path="/:username/watchers"
render={() => { render={() => {
return <WatchsUser {...this.props} {...this.state} userType="watchers" fetchUser={this.fetchUser}/>; return <WatchsUser {...this.props} {...this.state} userType="watchers" fetchUser={this.fetchUser}/>;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username/notice" path="/:username/notice"
render={() => { render={() => {
return <Notice {...this.props} {...this.state} deleteUndoEvent={this.deleteUndoEvent}/>; return <Notice {...this.props} {...this.state} deleteUndoEvent={this.deleteUndoEvent}/>;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username/fan_users" path="/:username/fan_users"
render={() => { render={() => {
return <FanUser {...this.props} {...this.state} userType="fan_users" fetchUser={this.fetchUser}/>; return <FanUser {...this.props} {...this.state} userType="fan_users" fetchUser={this.fetchUser}/>;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username/devops/CDService" path="/:username/devops/CDService"
render={() => { render={() => {
return <InfosDevOpsCD {...this.props} {...this.state} />; return <InfosDevOpsCD {...this.props} {...this.state} />;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username/devops/CIService" path="/:username/devops/CIService"
render={() => { render={() => {
return <InfosDevOps {...this.props} {...this.state} />; return <InfosDevOps {...this.props} {...this.state} />;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username/projects/:project_type" path="/:username/projects/:project_type"
render={() => { render={() => {
return <InfosUser {...this.props} {...this.state} />; return <InfosUser {...this.props} {...this.state} />;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username/organizes" path="/:username/organizes"
render={() => { render={() => {
return <Organize {...this.props} {...this.state} />; return <Organize {...this.props} {...this.state} />;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username/info" path="/:username/info"
render={() => { render={() => {
return <UpdateInfo {...this.props} {...this.state} resetUser={this.resetUser}/>; return <UpdateInfo {...this.props} {...this.state} resetUser={this.resetUser}/>;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username/password" path="/:username/password"
render={() => { render={() => {
return <UpdateInfo {...this.props} {...this.state}/>; return <UpdateInfo {...this.props} {...this.state}/>;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username/statistics" path="/:username/statistics"
render={(props) => { render={(props) => {
return <Statistics {...this.props} {...this.state} />; return <Statistics {...this.props} {...this.state} />;
}} }}
></Route> ></Route>
<Route <Route
path="/users/:username" path="/:username"
render={(props) => { render={(props) => {
return <GeneralView {...this.props} {...this.state} />; return <GeneralView {...this.props} {...this.state} />;
}} }}

View File

@ -45,7 +45,7 @@ export default Form.create()(
if(result && result.data){ if(result && result.data){
props.showNotification("资料修改成功!") props.showNotification("资料修改成功!")
resetUser && resetUser(result.data); resetUser && resetUser(result.data);
props.history.push(`/users/${username}`) props.history.push(`/${username}`)
} }
}).catch(error=>{}) }).catch(error=>{})
} }
@ -71,7 +71,7 @@ export default Form.create()(
{getFieldDecorator("real_name",{ {getFieldDecorator("real_name",{
rules:[{required:true,message:"请输入姓名"}] rules:[{required:true,message:"请输入姓名"}]
})( })(
<Input placeholder="请输入您的姓名" maxLength={"20"} style={{width:"400px"}}/> <Input placeholder="请输入您的姓名" maxLength={20} style={{width:"400px"}}/>
)} )}
</Form.Item> </Form.Item>
<div> <div>
@ -90,7 +90,7 @@ export default Form.create()(
{getFieldDecorator("custom_department",{ {getFieldDecorator("custom_department",{
rules:[{required:true,message:"请输入单位名称"}] rules:[{required:true,message:"请输入单位名称"}]
})( })(
<Input placeholder="请输入单位名称" maxLength="30" style={{width:"400px"}}/> <Input placeholder="请输入单位名称" maxLength={30} style={{width:"400px"}}/>
)} )}
</Form.Item> </Form.Item>
<Form.Item label=""> <Form.Item label="">
@ -120,13 +120,13 @@ export default Form.create()(
{getFieldDecorator("description",{ {getFieldDecorator("description",{
rules:[] rules:[]
})( })(
<TextArea placeholder="请输入您的自我简介" rows={4} maxLength="140" style={{width:"600px"}}/> <TextArea placeholder="请输入您的自我简介" rows={4} maxLength={140} style={{width:"600px"}}/>
)} )}
</Form.Item> </Form.Item>
<AlignCenter> <AlignCenter>
<span className="ant-form-item-label"></span> <span className="ant-form-item-label"></span>
<Button type={"primary"} onClick={submit}>提交</Button> <Button type={"primary"} onClick={submit}>提交</Button>
<Button type={"default"} onClick={()=>props.history.push(`/users/${username}`)} className="ml20">取消</Button> <Button type={"default"} onClick={()=>props.history.push(`/${username}`)} className="ml20">取消</Button>
</AlignCenter> </AlignCenter>
</Form> </Form>
) )

View File

@ -12,7 +12,7 @@ function Index(props){
useEffect(()=>{ useEffect(()=>{
if((username && current_user && (current_user.login !== username))){ if((username && current_user && (current_user.login !== username))){
props.history.push(`/users/${username}`); props.history.push(`/${username}`);
} }
},[current_user,username]) },[current_user,username])
@ -20,7 +20,7 @@ function Index(props){
useEffect(()=>{ useEffect(()=>{
if(pathname){ if(pathname){
if(pathname === `/users/${username}/info`){ if(pathname === `/${username}/info`){
setKey("0"); setKey("0");
}else{ }else{
setKey("1"); setKey("1");
@ -32,8 +32,8 @@ function Index(props){
return( return(
<div> <div>
<Menu selectedKeys={[key]} mode={'horizontal'} className="infosRightMenu"> <Menu selectedKeys={[key]} mode={'horizontal'} className="infosRightMenu">
<Menu.Item key="0"><Link to={`/users/${username}/info`}>基本资料</Link></Menu.Item> <Menu.Item key="0"><Link to={`/${username}/info`}>基本资料</Link></Menu.Item>
{/* <Menu.Item key="1"><Link to={`/users/${username}/password`}>密码管理</Link></Menu.Item> */} {/* <Menu.Item key="1"><Link to={`/${username}/password`}>密码管理</Link></Menu.Item> */}
</Menu> </Menu>
<div style={{padding:"20px"}}> <div style={{padding:"20px"}}>
{ {

View File

@ -90,7 +90,7 @@ export default Form.create()(
<AlignCenter style={{marginTop:"20px"}}> <AlignCenter style={{marginTop:"20px"}}>
<span className="ant-form-item-label"></span> <span className="ant-form-item-label"></span>
<Button type={"primary"} onClick={submit}>提交</Button> <Button type={"primary"} onClick={submit}>提交</Button>
<Button type={"default"} onClick={()=>props.history.push(`/users/${username}`)} className="ml20">取消</Button> <Button type={"default"} onClick={()=>props.history.push(`/${username}`)} className="ml20">取消</Button>
</AlignCenter> </AlignCenter>
</Form> </Form>
) )

View File

@ -150,11 +150,11 @@ function Index(props) {
{ {
percentData && percentData &&
<div className="pBox"> <div className="pBox">
<div class="progress"> <div className="progress">
{ {
percentData.map((i,k)=>{ percentData.map((i,k)=>{
return( return(
<span style={{width: `${i.p}%`, backgroundColor:`${i.color}`}}></span> <span key={i.name} style={{width: `${i.p}%`, backgroundColor:`${i.color}`}}></span>
) )
}) })
} }
@ -163,8 +163,8 @@ function Index(props) {
{ {
percentData.map((i,k)=>{ percentData.map((i,k)=>{
return( return(
<span> <span key={i.name}>
<i class="zero" style={{backgroundColor: `${i.color}`}}></i><span>{i.name}</span> <i className="zero" style={{backgroundColor: `${i.color}`}}></i><span>{i.name}</span>
<span>{`${i.p}%`}</span> <span>{`${i.p}%`}</span>
</span> </span>
) )

View File

@ -91,7 +91,7 @@ class CommonList extends Component {
<Spin spinning={isSpin}> <Spin spinning={isSpin}>
<div className="minH-670"> <div className="minH-670">
<div className="grid-item pb20 bbt"> <div className="grid-item pb20 bbt">
<h3 style={{marginBottom:"0px"}}><Link to={`/users/${login}`} ><i className="iconfont icon-zuojiantou color-grey-9 font-16 mr8"></i></Link>{userType === "watch_users" ? `${title_type}` : `${title_type}`}</h3> <h3 style={{marginBottom:"0px"}}><Link to={`/${login}`} ><i className="iconfont icon-zuojiantou color-grey-9 font-16 mr8"></i></Link>{userType === "watch_users" ? `${title_type}` : `${title_type}`}</h3>
<div className="text-right"> <div className="text-right">
<Search <Search
placeholder="输入名称进行搜索" placeholder="输入名称进行搜索"

View File

@ -2,7 +2,7 @@ import './public-path'
import { AppContainer } from 'react-hot-loader'; import { AppContainer } from 'react-hot-loader';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { BrowserRouter, Route } from 'react-router-dom'
import './index.css'; import './index.css';
import App from './App'; import App from './App';
import { configureUrlQuery } from 'react-url-query'; import { configureUrlQuery } from 'react-url-query';
@ -17,7 +17,10 @@ window.__useKindEditor = false;
const render = (Component) => { const render = (Component) => {
ReactDOM.render( ReactDOM.render(
<AppContainer > <AppContainer >
<Component /> {/* <Component /> */}
<BrowserRouter basename='/'>
<Route path={`/`} component={App}></Route>
</BrowserRouter>
</AppContainer>, </AppContainer>,
document.getElementById('root') document.getElementById('root')
) )

View File

@ -74,7 +74,7 @@ class Comments extends Component {
<div key={index} className="childComment" > <div key={index} className="childComment" >
<div className="J_Comment_Info clearfix mt3"> <div className="J_Comment_Info clearfix mt3">
<div className="t_info fl"> <div className="t_info fl">
<a href={`${_origin}/users/${item.user_login}`} className="content-username hide fl"> <a href={`${_origin}/${item.user_login}`} className="content-username hide fl">
{item.username} {item.username}
</a> </a>
<span className="t_area fl">{item.time}</span> <span className="t_area fl">{item.time}</span>
@ -139,13 +139,13 @@ class Comments extends Component {
if (!comments || comments.length === 0) { if (!comments || comments.length === 0) {
return; return;
} }
// "https://www.educoder.net/users/m02945638" // "https://www.educoder.net/m02945638"
let commentsElement = comments.map((item, index) => { let commentsElement = comments.map((item, index) => {
return ( return (
<div className="comment_item_cont df clearfix" key={index}> <div className="comment_item_cont df clearfix" key={index}>
<div className="J_Comment_Face fl"> <div className="J_Comment_Face fl">
<a href={`${_origin}/users/${item.user_login}`} target="_blank"> <a href={`${_origin}/${item.user_login}`} target="_blank">
<img alt="用户头像" height="50" src={getImageUrl(`images/${item.image_url}`)} width="50" /> <img alt="用户头像" height="50" src={getImageUrl(`images/${item.image_url}`)} width="50" />
</a> </a>
</div> </div>
@ -155,7 +155,7 @@ class Comments extends Component {
<div className="comment_orig_content" style={{ margin: "0px" }}> <div className="comment_orig_content" style={{ margin: "0px" }}>
<div className="J_Comment_Info clearfix mt3"> <div className="J_Comment_Info clearfix mt3">
<div className="t_info fl"> <div className="t_info fl">
<a href={`${_origin}/users/${item.user_login}`} className="content-username hide fl"> <a href={`${_origin}/${item.user_login}`} className="content-username hide fl">
{item.username} {item.username}
</a> </a>
<span className="t_area fl">{item.time}</span> <span className="t_area fl">{item.time}</span>

View File

@ -71,7 +71,7 @@ export function commentHOC(WrappedComponent) {
image_url: "avatar/User/36497" image_url: "avatar/User/36497"
login: "p24891375" login: "p24891375"
name: "杨俊男" name: "杨俊男"
user_url: "/users/p24891375" user_url: "/p24891375"
*/ */
handleComments(comments, responseData) { handleComments(comments, responseData) {
comments.forEach(element => { comments.forEach(element => {

View File

@ -188,7 +188,7 @@ class CCommentItem extends Component {
<img alt="用户头像" height="50" <img alt="用户头像" height="50"
src={`${getUrl()}/images/edu_user/anony.png`} width="50" /> src={`${getUrl()}/images/edu_user/anony.png`} width="50" />
</a> </a>
: <a href={`${_origin}/users/${item.user_info.user_login}`} target="_blank"> : <a href={`${_origin}/${item.user_info.user_login}`} target="_blank">
<img alt="用户头像" height="50" <img alt="用户头像" height="50"
src={`${getImageUrl(`images/` + imgSrc)}`} src={`${getImageUrl(`images/` + imgSrc)}`}
width="50" /> width="50" />
@ -204,7 +204,7 @@ class CCommentItem extends Component {
<a className="content-username hide fl"> <a className="content-username hide fl">
{item.user_info.user_name} {item.user_info.user_name}
</a> </a>
: <a href={`${_origin}/users/${item.user_info.user_login}`} className="content-username hide fl"> : <a href={`${_origin}/${item.user_info.user_login}`} className="content-username hide fl">
{item.user_info.user_name} {item.user_info.user_name}
</a>} </a>}
@ -275,7 +275,7 @@ class CCommentItem extends Component {
<img alt="用户头像" height="50" <img alt="用户头像" height="50"
src={`${getUrl()}/images/edu_user/anony.png`} width="50" /> src={`${getUrl()}/images/edu_user/anony.png`} width="50" />
</a> </a>
: <a href={`${_origin}/users/${item.user_login}`} target="_blank"> : <a href={`${_origin}/${item.user_login}`} target="_blank">
<img alt="用户头像" height="50" <img alt="用户头像" height="50"
src={`${getUrl()}/images/${item.image_url}`} src={`${getUrl()}/images/${item.image_url}`}
width="50" /> width="50" />
@ -292,7 +292,7 @@ class CCommentItem extends Component {
{item.username}{item.comment_role} {item.username}{item.comment_role}
</a> </a>
: :
<a href={`${_origin}/users/${item.user_login}`} className="content-username hide fl"> <a href={`${_origin}/${item.user_login}`} className="content-username hide fl">
{item.username}{item.comment_role} {item.username}{item.comment_role}
</a> </a>
} }

View File

@ -37,7 +37,7 @@ class CommonReply extends Component {
} }
_getUser() { _getUser() {
const { current_user } = this.props; const { current_user } = this.props;
current_user.user_url = `/users/${current_user.login}`; current_user.user_url = `/${current_user.login}`;
return current_user; return current_user;
} }
_findById = _findById _findById = _findById

View File

@ -84,7 +84,7 @@ class CompetitionContents extends Component{
dataIndex: 'userimg', dataIndex: 'userimg',
key: 'userimg', key: 'userimg',
render: (text, record) =>( render: (text, record) =>(
<a href={`/users/${record.user_login}`} target={"_blank"} className="color-dark"> <a href={`/${record.user_login}`} target={"_blank"} className="color-dark">
<div className={"relativef"}> <div className={"relativef"}>
<img className={"Competitionuserimg mb10"} src={getImageUrl(`images/${record.userimg===null?`avatars/User/0?1442652658`:record.userimg}`)}/> <img className={"Competitionuserimg mb10"} src={getImageUrl(`images/${record.userimg===null?`avatars/User/0?1442652658`:record.userimg}`)}/>
<div className={"competimgabsoluteijmg"}><Badge count={record.competition_prize} style={{ backgroundColor: '#459BE5' }} title={record.competition_prize}/></div> <div className={"competimgabsoluteijmg"}><Badge count={record.competition_prize} style={{ backgroundColor: '#459BE5' }} title={record.competition_prize}/></div>
@ -212,7 +212,7 @@ class CompetitionContents extends Component{
<li className="pr Competitioncenter"> <li className="pr Competitioncenter">
<img src={getImageUrl("images/educoder/huangguan-two.png")}/> <img src={getImageUrl("images/educoder/huangguan-two.png")}/>
<div className={"mt10"}> <div className={"mt10"}>
<a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark "> <a href={`/${item.user_login}`} target={"_blank"} className="color-dark ">
<div className={"relativef"}> <div className={"relativef"}>
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} /> <img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
<div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} title={item.competition_prize}/></div> <div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} title={item.competition_prize}/></div>
@ -251,7 +251,7 @@ class CompetitionContents extends Component{
<li className="pr Competitioncenter"> <li className="pr Competitioncenter">
<img src={getImageUrl("/images/educoder/huangguan.png")}/> <img src={getImageUrl("/images/educoder/huangguan.png")}/>
<div className={"mt10"}> <div className={"mt10"}>
<a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark"> <a href={`/${item.user_login}`} target={"_blank"} className="color-dark">
<div className={"relativef"}> <div className={"relativef"}>
<img className={"rankingimg"} src={getImageUrl(`/images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} /> <img className={"rankingimg"} src={getImageUrl(`/images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
<div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} title={item.competition_prize}/></div> <div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} title={item.competition_prize}/></div>
@ -290,7 +290,7 @@ class CompetitionContents extends Component{
<li className=" pr Competitioncenter "> <li className=" pr Competitioncenter ">
<img src={getImageUrl("images/educoder/huangguan-three.png")}/> <img src={getImageUrl("images/educoder/huangguan-three.png")}/>
<div className={"mt10"}> <div className={"mt10"}>
<a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark"> <a href={`/${item.user_login}`} target={"_blank"} className="color-dark">
<div className={"relativef"}> <div className={"relativef"}>
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} /> <img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
<div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} title={item.competition_prize}/></div> <div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} title={item.competition_prize}/></div>

View File

@ -360,7 +360,7 @@ class CoursesBanner extends Component {
var url = `/courses/${id}/exit_course.json`; var url = `/courses/${id}/exit_course.json`;
axios.post(url).then((response) => { axios.post(url).then((response) => {
if (response.data.status === 0) { if (response.data.status === 0) {
window.location.href = "/users/" + this.props.current_user.login; window.location.href = "/" + this.props.current_user.login;
} }
}) })
} }
@ -543,11 +543,11 @@ class CoursesBanner extends Component {
<div className="clearfix "> <div className="clearfix ">
<div className="flex-container mr40 mb20" > <div className="flex-container mr40 mb20" >
<a href={"/users/" + coursedata.teacher_login} > <a href={"/" + coursedata.teacher_login} >
<img alt="头像" className="radius mt3 bannerimgname" <img alt="头像" className="radius mt3 bannerimgname"
src={getImageUrl(`images/` + coursedata.teacher_img)} /> src={getImageUrl(`images/` + coursedata.teacher_img)} />
</a> </a>
<a href={"/users/" + coursedata.teacher_login} className="mt13 color-white bannnerusername mt13">{coursedata.teacher_name}</a> <a href={"/" + coursedata.teacher_login} className="mt13 color-white bannnerusername mt13">{coursedata.teacher_name}</a>
<p className="mt13 color-white bannnerusernames">{coursedata.teacher_school}</p> <p className="mt13 color-white bannnerusernames">{coursedata.teacher_school}</p>
</div> </div>

View File

@ -414,7 +414,7 @@ class ShixunhomeWorkItem extends Component{
<div className="cl"></div> <div className="cl"></div>
<p className="color-grey mt15 fl" style={{"width":"820px"}}> <p className="color-grey mt15 fl" style={{"width":"820px"}}>
<span > <span >
{/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */} {/* <a href="/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */}
{ discussMessage.author && <span className="mr15 color-grey-3">{discussMessage.author}</span> } { discussMessage.author && <span className="mr15 color-grey-3">{discussMessage.author}</span> }
{discussMessage.commit_count===undefined?"":<span className="mr15 color-grey9">已开始做题 {discussMessage.commit_count}</span>} {discussMessage.commit_count===undefined?"":<span className="mr15 color-grey9">已开始做题 {discussMessage.commit_count}</span>}
{discussMessage.uncommit_count===undefined?"":<span className="mr15 color-grey9">未开始做题 {discussMessage.uncommit_count}</span>} {discussMessage.uncommit_count===undefined?"":<span className="mr15 color-grey9">未开始做题 {discussMessage.uncommit_count}</span>}

View File

@ -161,7 +161,7 @@ class Home extends React.Component {
{ {
managers && managers.map((manager) => { managers && managers.map((manager) => {
return ( return (
<Link to={`/users/${manager.login}`} key={manager.id} className="ec-school-manager-item"> <Link to={`/${manager.login}`} key={manager.id} className="ec-school-manager-item">
<Avatar size={48} src={getImageUrl(`images/${manager.image_url}`)} alt="头像"/> <Avatar size={48} src={getImageUrl(`images/${manager.image_url}`)} alt="头像"/>
<Tooltip title={manager.name} placement="bottom"> <Tooltip title={manager.name} placement="bottom">
<span className="ec-school-manager-name">{ manager.name }</span> <span className="ec-school-manager-name">{ manager.name }</span>

View File

@ -34,7 +34,7 @@ class Leftdialogue extends Component{
this.props.DELETEsetreplyfun(user_id,id); this.props.DELETEsetreplyfun(user_id,id);
} }
myCome=(e)=>{ myCome=(e)=>{
window.location.href="/users/"+e.login; window.location.href="/"+e.login;
} }
render() { render() {

View File

@ -272,13 +272,13 @@ class MessagSub extends Component {
return window.open(`/forums/`); return window.open(`/forums/`);
case "Watcher" : case "Watcher" :
// 用户个人中心页 :id = item.trigger_user.login // 用户个人中心页 :id = item.trigger_user.login
return window.open(`/users/${item.trigger_user.login}/classrooms`) return window.open(`/${item.trigger_user.login}/classrooms`)
case "PraiseTread" : case "PraiseTread" :
// 这块太复杂 不好处理 // 这块太复杂 不好处理
return ''; return '';
case "Grade" : case "Grade" :
//个人中心页 :id = item.trigger_user.login //个人中心页 :id = item.trigger_user.login
// return window.open(`/users/${item.trigger_user.login}/classrooms`; // return window.open(`/${item.trigger_user.login}/classrooms`;
return ""; return "";
case "JoinProject" : case "JoinProject" :
//项目详情-申请加入项目审核页 :id = container_id //项目详情-申请加入项目审核页 :id = container_id
@ -484,7 +484,7 @@ class MessagSub extends Component {
if (item.tiding_type === "Apply") { if (item.tiding_type === "Apply") {
return window.open(`/admins/video_applies`); return window.open(`/admins/video_applies`);
} else if (item.tiding_type === "System") { } else if (item.tiding_type === "System") {
return window.open(`/users/${this.props.current_user.login}/videos`); return window.open(`/${this.props.current_user.login}/videos`);
} }
return ''; return '';
case "PublicCourseStart": case "PublicCourseStart":

View File

@ -140,7 +140,7 @@ class MessagePrivate extends Component{
this.props.Modifyur(i,id); this.props.Modifyur(i,id);
}; };
myCome=(e)=>{ myCome=(e)=>{
window.location.href="/users/"+e.target.login; window.location.href="/"+e.target.login;
} }
render() { render() {
let{page,limit,typeysl,count,isSpin,data,modalsType}=this.state; let{page,limit,typeysl,count,isSpin,data,modalsType}=this.state;

View File

@ -133,7 +133,7 @@ class Messagerouting extends Component{
}; };
myCome=(e)=>{ myCome=(e)=>{
window.location.href="/users/"+e.target.login; window.location.href="/"+e.target.login;
} }
myxiaoxisixintab=(i)=>{ myxiaoxisixintab=(i)=>{

View File

@ -36,7 +36,7 @@ class Rightdialogue extends Component{
this.props.DELETEsetreplyfun(user_id,id); this.props.DELETEsetreplyfun(user_id,id);
} }
myCome=(e)=>{ myCome=(e)=>{
window.location.href="/users/"+e.login; window.location.href="/"+e.login;
} }
render() { render() {

View File

@ -37,10 +37,10 @@ class LeftNav extends Component {
<div className="page--leftnav"> <div className="page--leftnav">
<div className="user-info"> <div className="user-info">
<a href="/users/p69243850" alt="用户头像" className="user-info-img"> <a href="/p69243850" alt="用户头像" className="user-info-img">
<img alt="0?1442652658" height="50" src="/images/avatars/User/0?1442652658" width="50"/> <img alt="0?1442652658" height="50" src="/images/avatars/User/0?1442652658" width="50"/>
</a> </a>
<a href="/users/p69243850" className="user-info-name">Jimmy</a> <a href="/p69243850" className="user-info-name">Jimmy</a>
</div> </div>
<div className="leftnav"> <div className="leftnav">
<ul> <ul>

View File

@ -724,16 +724,16 @@ class NewHeader extends Component {
if (new_link && (new_link.indexOf("courses") > -1 || new_link.indexOf("contests") > -1)) { if (new_link && (new_link.indexOf("courses") > -1 || new_link.indexOf("contests") > -1)) {
if (user_login) { if (user_login) {
if (new_link.indexOf("courses") > -1) { if (new_link.indexOf("courses") > -1) {
new_link = new_link.replace(/courses/g, "users/" + user_login + "/courses") new_link = new_link.replace(/courses/g, user_login + "/courses")
} else if (new_link.indexOf("contests") > -1) { } else if (new_link.indexOf("contests") > -1) {
new_link = new_link.replace(/contests/g, "users/" + user_login + "/contests") new_link = new_link.replace(/contests/g, user_login + "/contests")
} }
} else { } else {
is_hidden = true is_hidden = true
} }
} }
if (user_login && (new_link && new_link.indexOf("homes") > -1)) { if (user_login && (new_link && new_link.indexOf("homes") > -1)) {
new_link = new_link.replace(/homes/g, "users/" + user_login + "/user_activities") new_link = new_link.replace(/homes/g, user_login + "/user_activities")
} }
var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) ); var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) );
@ -826,7 +826,7 @@ class NewHeader extends Component {
</span> </span>
: :
<div className="ml30 edu-menu-panel" style={{ height: "70px", lineHeight: "70px" }}> <div className="ml30 edu-menu-panel" style={{ height: "70px", lineHeight: "70px" }}>
<a href={`/users/${this.props.current_user === undefined ? "" : this.props.current_user.login}/courses`}> <a href={`/${this.props.current_user === undefined ? "" : this.props.current_user.login}/courses`}>
<img alt="头像" className="radius" height="34" id="nh_user_logo" name="avatar_image" <img alt="头像" className="radius" height="34" id="nh_user_logo" name="avatar_image"
src={getImageUrl(`images/` + user.image_url)} width="34"> src={getImageUrl(`images/` + user.image_url)} width="34">
</img> </img>

View File

@ -154,7 +154,7 @@ export function TPMIndexHOC(WrappedComponent) {
tpmLoading: false tpmLoading: false
}) })
if (this.props.match.path === "/" && response.data.login) { if (this.props.match.path === "/" && response.data.login) {
this.props.history.push(`/users/${response.data.login}`); this.props.history.push(`/${response.data.login}`);
} }
if(response.data && response.data.login){ if(response.data && response.data.login){
if(response.data.need_edit_info){ if(response.data.need_edit_info){

View File

@ -62,7 +62,7 @@ class TPMRightSection extends Component {
<p className="font-16 mb20"><i className={"iconfont icon-chuangjianzhe1 audit_situationactive font-14"}></i> </p> <p className="font-16 mb20"><i className={"iconfont icon-chuangjianzhe1 audit_situationactive font-14"}></i> </p>
<div className="df"> <div className="df">
<a <a
href={TPMRightSectionData === undefined ? "" : TPMRightSectionData.creator === undefined ? "" : `/users/${TPMRightSectionData.creator.login}/classrooms`}> href={TPMRightSectionData === undefined ? "" : TPMRightSectionData.creator === undefined ? "" : `/${TPMRightSectionData.creator.login}/classrooms`}>
<img alt="头像" className="radius mr10" height="36" <img alt="头像" className="radius mr10" height="36"
src={getImageUrl(TPMRightSectionData === undefined ? "" : TPMRightSectionData.creator === undefined ? "" : 'images/' + TPMRightSectionData.creator.image_url + "?1532489442")} src={getImageUrl(TPMRightSectionData === undefined ? "" : TPMRightSectionData.creator === undefined ? "" : 'images/' + TPMRightSectionData.creator.image_url + "?1532489442")}
width="36" /> width="36" />

View File

@ -139,7 +139,7 @@ class ShixunDiscuss extends Component {
<div className="commentItemMDEditorView commentItemMDEditorView_4220" style={{display:'none'}}> <div className="commentItemMDEditorView commentItemMDEditorView_4220" style={{display:'none'}}>
<div className="homepagePostReplyPortrait mr15 fl imageFuzzy" id="reply_image_3097" style={{marginTop: '28px', marginRight: '0px'}}> <div className="homepagePostReplyPortrait mr15 fl imageFuzzy" id="reply_image_3097" style={{marginTop: '28px', marginRight: '0px'}}>
<a href="/users/innov" target="_blank" alt="用户头像"> <a href="/innov" target="_blank" alt="用户头像">
<img alt="0?1442652658" height="33" src="/images/avatars/User/1" width="33"/> <img alt="0?1442652658" height="33" src="/images/avatars/User/1" width="33"/>
</a> </a>
</div> </div>

View File

@ -239,63 +239,63 @@ class Infos extends Component {
{/* --------------------------------------------------------------------- */} {/* --------------------------------------------------------------------- */}
{/* 题库 */} {/* 题库 */}
<Route exact path="/users/:username/topics/:topicstype" <Route exact path="/:username/topics/:topicstype"
render={ render={
(props) => (<InfosTopics {...this.props} {...props} {...this.state} {..._commonProps} />) (props) => (<InfosTopics {...this.props} {...props} {...this.state} {..._commonProps} />)
} }
></Route> ></Route>
{/* 课堂 */} {/* 课堂 */}
<Route exact path="/users/:username/classrooms" <Route exact path="/:username/classrooms"
render={ render={
(props) => (<InfosCourse {...this.props} {...props} {...this.state} {..._commonProps} />) (props) => (<InfosCourse {...this.props} {...props} {...this.state} {..._commonProps} />)
} }
></Route> ></Route>
{/* 实训项目 */} {/* 实训项目 */}
<Route exact path="/users/:username/shixuns" <Route exact path="/:username/shixuns"
render={ render={
(props) => (<InfosShixun {...this.props} {...props} {...this.state} {..._commonProps} />) (props) => (<InfosShixun {...this.props} {...props} {...this.state} {..._commonProps} />)
} }
></Route> ></Route>
{/* 实践课程 */} {/* 实践课程 */}
<Route exact path="/users/:username/paths" <Route exact path="/:username/paths"
render={ render={
(props) => (<InfosPath {...this.props} {...props} {...this.state} {..._commonProps} />) (props) => (<InfosPath {...this.props} {...props} {...this.state} {..._commonProps} />)
} }
></Route> ></Route>
{/* 开发项目 */} {/* 开发项目 */}
{/* <Route exact path="/users/:username/projects" {/* <Route exact path="/:username/projects"
render={ render={
(props) => (<InfosProject {...this.props} {...props} {...this.state} {..._commonProps} />) (props) => (<InfosProject {...this.props} {...props} {...this.state} {..._commonProps} />)
} }
></Route> */} ></Route> */}
<Route exact path="/users/:username/projects" <Route exact path="/:username/projects"
render={ render={
(props) => (<UserProjects {...this.props} {...props} {...this.state} {..._commonProps}/>) (props) => (<UserProjects {...this.props} {...props} {...this.state} {..._commonProps}/>)
} }
></Route> ></Route>
{/* 众包 */} {/* 众包 */}
<Route exact path="/users/:username/package" <Route exact path="/:username/package"
render={ render={
(props) => (<InfosPackage {...this.props} {...props} {...this.state} {..._commonProps} />) (props) => (<InfosPackage {...this.props} {...props} {...this.state} {..._commonProps} />)
} }
></Route> ></Route>
{/* 视频 */} {/* 视频 */}
<Route exact path="/users/:username/videos" <Route exact path="/:username/videos"
render={ render={
(props) => (<InfosVideo {...this.props} {...props} {...this.state} {..._commonProps} />) (props) => (<InfosVideo {...this.props} {...props} {...this.state} {..._commonProps} />)
} }
></Route> ></Route>
<Route exact path="/users/:username" <Route exact path="/:username"
render={ render={
(props) => (<InfosCourse {...this.props} {...props} {...this.state} {..._commonProps} />) (props) => (<InfosCourse {...this.props} {...props} {...this.state} {..._commonProps} />)
} }

View File

@ -139,22 +139,22 @@ class InfosBanner extends Component{
{/*{coursestypes===true?"":<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>*/} {/*{coursestypes===true?"":<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>*/}
{/*<Link*/} {/*<Link*/}
{/*onClick={() => this.setState({moduleName: 'courses'})}*/} {/*onClick={() => this.setState({moduleName: 'courses'})}*/}
{/*to={`/users/${username}/courses`}>翻转课堂</Link>*/} {/*to={`/${username}/courses`}>翻转课堂</Link>*/}
{/*</li>}*/} {/*</li>}*/}
{/*{shixuntype===true?"":<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>*/} {/*{shixuntype===true?"":<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>*/}
{/*<Link*/} {/*<Link*/}
{/*onClick={() => this.setState({moduleName: 'shixuns'})}*/} {/*onClick={() => this.setState({moduleName: 'shixuns'})}*/}
{/*to={`/users/${username}/shixuns`}>实训项目</Link>*/} {/*to={`/${username}/shixuns`}>实训项目</Link>*/}
{/*</li>}*/} {/*</li>}*/}
{/*{pathstype===true?"":<li className={`${moduleName == 'paths' ? 'active' : '' }`}>*/} {/*{pathstype===true?"":<li className={`${moduleName == 'paths' ? 'active' : '' }`}>*/}
{/*<Link */} {/*<Link */}
{/*onClick={() => this.setState({moduleName: 'paths'})}*/} {/*onClick={() => this.setState({moduleName: 'paths'})}*/}
{/*to={`/users/${username}/paths`}>实践课程</Link>*/} {/*to={`/${username}/paths`}>实践课程</Link>*/}
{/*</li>}*/} {/*</li>}*/}
<li className={`${moduleName === 'projects' ? 'active' : '' }`}> <li className={`${moduleName === 'projects' ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'projects'})} onClick={() => this.setState({moduleName: 'projects'})}
to={`/users/${username}`}>开发项目</Link> to={`/${username}`}>开发项目</Link>
</li> </li>

View File

@ -29,22 +29,22 @@ class InfosIndex extends Component {
return ( return (
<Switch {...this.props}> <Switch {...this.props}>
{/* 视频发布 */} {/* 视频发布 */}
<Route exact path="/users/:username/videos/upload" <Route exact path="/:username/videos/upload"
render={ render={
(props) => (<VideoUploadList {...this.props} {...props} {...this.state} />) (props) => (<VideoUploadList {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route exact path="/users/:username/videos/success" <Route exact path="/:username/videos/success"
render={ render={
(props) => (<VideoPublishSuccess {...this.props} {...props} {...this.state} />) (props) => (<VideoPublishSuccess {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route exact path="/users/:username/videos/protocol" <Route exact path="/:username/videos/protocol"
render={ render={
(props) => (<VideoProtocol {...this.props} {...props} {...this.state} />) (props) => (<VideoProtocol {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route path="/users/:username" <Route path="/:username"
render={ render={
(props) => (<UsersInfo {...this.props} {...props} {...this.state} />) (props) => (<UsersInfo {...this.props} {...props} {...this.state} />)
} }

View File

@ -427,7 +427,7 @@ class InfosTopics extends Component{
<div className="clearfix topicsbox"> <div className="clearfix topicsbox">
{types==="publicly"?<div className={"topcschild"}> {types==="publicly"?<div className={"topcschild"}>
<a className={types==="personal"?"topicstopfont fr ":"topicstopfont fr topcsactive"} <a className={types==="personal"?"topicstopfont fr ":"topicstopfont fr topcsactive"}
href={`/users/${this.props.current_user&&this.props.current_user.login}/topics/personal`}>我的题库</a> href={`/${this.props.current_user&&this.props.current_user.login}/topics/personal`}>我的题库</a>
<div className={types==="publicly"?"topicstopfont fl ":"topicstopfont fl topcsactive"} <div className={types==="publicly"?"topicstopfont fl ":"topicstopfont fl topcsactive"}
>公共题库</div> >公共题库</div>
</div>:<div className={"topcschild"}> </div>:<div className={"topcschild"}>

View File

@ -127,7 +127,7 @@ class BanksIndex extends Component{
{ {
crumbData && crumbData &&
<Breadcrumb separator=">" className="breadcrumb mt22"> <Breadcrumb separator=">" className="breadcrumb mt22">
<Breadcrumb.Item href={crumbData && crumbData.is_public == true ?`/topicbank/publicly`:`/users/${this.props.current_user && this.props.current_user.login}/topics/personal`}>{ crumbData && crumbData.is_public == true ? '公共' : '我的' }题库</Breadcrumb.Item> <Breadcrumb.Item href={crumbData && crumbData.is_public == true ?`/topicbank/publicly`:`/${this.props.current_user && this.props.current_user.login}/topics/personal`}>{ crumbData && crumbData.is_public == true ? '公共' : '我的' }题库</Breadcrumb.Item>
{ {
crumbData.crumbArray && crumbData.crumbArray.map((item,key)=>{ crumbData.crumbArray && crumbData.crumbArray.map((item,key)=>{
return( return(

View File

@ -97,7 +97,7 @@ class BanksMenu extends Component{
if(response.data){ if(response.data){
if(response.data.status===0){ if(response.data.status===0){
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
window.location.href=`/users/${this.props.current_user.login}/topics/personal`; window.location.href=`/${this.props.current_user.login}/topics/personal`;
}else{ }else{
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
} }

View File

@ -153,28 +153,28 @@ class banner_out extends Component {
<li className={`${moduleName == 'classrooms' || moduleName == undefined ? 'active' : ''}`}> <li className={`${moduleName == 'classrooms' || moduleName == undefined ? 'active' : ''}`}>
<Link <Link
onClick={() => this.setState({ moduleName: 'classrooms' })} onClick={() => this.setState({ moduleName: 'classrooms' })}
to={`/users/${username}/classrooms`}>课堂</Link> to={`/${username}/classrooms`}>课堂</Link>
</li> </li>
<li className={`${moduleName == 'shixuns' ? 'active' : ''}`}> <li className={`${moduleName == 'shixuns' ? 'active' : ''}`}>
<Link <Link
onClick={() => this.setState({ moduleName: 'shixuns' })} onClick={() => this.setState({ moduleName: 'shixuns' })}
to={`/users/${username}/shixuns`}>实训</Link> to={`/${username}/shixuns`}>实训</Link>
</li> </li>
<li className={`${moduleName == 'paths' ? 'active' : ''}`}> <li className={`${moduleName == 'paths' ? 'active' : ''}`}>
<Link <Link
onClick={() => this.setState({ moduleName: 'paths' })} onClick={() => this.setState({ moduleName: 'paths' })}
to={`/users/${username}/paths`}>实践课程</Link> to={`/${username}/paths`}>实践课程</Link>
</li> </li>
<li className={`${moduleName == 'projects' ? 'active' : ''}`}> <li className={`${moduleName == 'projects' ? 'active' : ''}`}>
<Link <Link
onClick={() => this.setState({ moduleName: 'projects' })} onClick={() => this.setState({ moduleName: 'projects' })}
to={`/users/${username}`}>开发项目</Link> to={`/${username}`}>开发项目</Link>
</li> </li>
<li className={`${moduleName == 'package' ? 'active' : ''}`}> <li className={`${moduleName == 'package' ? 'active' : ''}`}>
<Link <Link
onClick={() => this.setState({ moduleName: 'package' })} onClick={() => this.setState({ moduleName: 'package' })}
to={`/users/${username}/package`}>众包</Link> to={`/${username}/package`}>众包</Link>
</li> </li>
{/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/} {/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/}

View File

@ -20,16 +20,16 @@ function EditVideoModal (props) {
} }
function toList() { function toList() {
history.push(`/users/${username}/videos`) history.push(`/${username}/videos`)
} }
function toUpload() { function toUpload() {
history.push(`/users/${username}/videos/upload`) history.push(`/${username}/videos/upload`)
} }
function onOk() { function onOk() {
form.validateFieldsAndScroll((err, values) => { form.validateFieldsAndScroll((err, values) => {
if (!err) { if (!err) {
const url = link?`/course_videos/${videoId}.json`:`/users/${username}/videos/${videoId}.json`; const url = link?`/course_videos/${videoId}.json`:`/${username}/videos/${videoId}.json`;
axios.put(url, link ? { axios.put(url, link ? {
name:_title, name:_title,

View File

@ -72,7 +72,7 @@ function InfoVideo(props) {
function toUpload() { function toUpload() {
if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) { if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) {
history.push(`/users/${username}/videos/upload`) history.push(`/${username}/videos/upload`)
} else { } else {
props.showProfessionalCertificationDialog() props.showProfessionalCertificationDialog()
} }

View File

@ -42,10 +42,10 @@ function VideoInReviewItem (props) {
const username = props.match.params.username const username = props.match.params.username
function toList() { function toList() {
history.push(`/users/${username}/videos`) history.push(`/${username}/videos`)
} }
function toUpload() { function toUpload() {
history.push(`/users/${username}/videos/upload`) history.push(`/${username}/videos/upload`)
} }
const imgUrl = (!transcoded && !link) ? defaultImg : (cover_url || defaultImg); const imgUrl = (!transcoded && !link) ? defaultImg : (cover_url || defaultImg);
return ( return (

View File

@ -10,10 +10,10 @@ function VideoUpload (props) {
const username = props.match.params.username const username = props.match.params.username
function toList() { function toList() {
history.push(`/users/${username}/videos`) history.push(`/${username}/videos`)
} }
function toUpload() { function toUpload() {
history.push(`/users/${username}/videos/upload`) history.push(`/${username}/videos/upload`)
} }
return ( return (

View File

@ -254,7 +254,7 @@ function VideoUploadList(props) {
if (flag) { if (flag) {
successFunc(false) successFunc(false)
} else { } else {
history.push(`/users/${username}/videos/success`) history.push(`/${username}/videos/success`)
} }
} }
} }
@ -269,9 +269,9 @@ function VideoUploadList(props) {
const { flag, CourseId } = props; const { flag, CourseId } = props;
const urls = const urls =
flag ? flag ?
<Link to={`/users/${username}/videos/protocol?course=${CourseId}`} target="_blank" style={{ color: theme.foreground_select }}>上传内容协议</Link> <Link to={`/${username}/videos/protocol?course=${CourseId}`} target="_blank" style={{ color: theme.foreground_select }}>上传内容协议</Link>
: :
<Link to={`/users/${username}/videos/protocol`} style={{ color: theme.foreground_select }}>上传内容协议</Link> <Link to={`/${username}/videos/protocol`} style={{ color: theme.foreground_select }}>上传内容协议</Link>
const protocolLine = <div>上传视频即表示您已同意{urls}不得上传未经他人授权的作品</div> const protocolLine = <div>上传视频即表示您已同意{urls}不得上传未经他人授权的作品</div>
return ( return (
<div className={flag ? "edu-back-white pb100 videoUploadList" : "educontent videoUploadList"} style={{ marginBottom: `${flag ? "0px" : "200px"}` }}> <div className={flag ? "edu-back-white pb100 videoUploadList" : "educontent videoUploadList"} style={{ marginBottom: `${flag ? "0px" : "200px"}` }}>