forked from Gitlink/forgeplus-react
地址改为zone
This commit is contained in:
parent
a5ad215a2d
commit
43b1702d9b
|
|
@ -160,7 +160,7 @@ const Topic = Loadable({
|
|||
})
|
||||
|
||||
// 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。
|
||||
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","information"];
|
||||
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone"];
|
||||
|
||||
class App extends Component {
|
||||
constructor(props) {
|
||||
|
|
@ -381,7 +381,7 @@ class App extends Component {
|
|||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path={"/information/:deptId"}
|
||||
path={"/zone/:deptId"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<Information {...this.props} {...props} {...this.state} />)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ function Hot({list , title,deptId}){
|
|||
return(
|
||||
<li>
|
||||
<span style={{opacity:k<3 ? `${1-((k+1)/10)}` :"0.3"}}>{k+1}</span>
|
||||
<Link to={`/information/${deptId}/newdetail/${i.id}`}>{i.name}</Link>
|
||||
<Link to={`/zone/${deptId}/newdetail/${i.id}`}>{i.name}</Link>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ function PublicBanner(props){
|
|||
|
||||
useEffect(()=>{
|
||||
if(pathname){
|
||||
const info = /\/information\/[0-9]{0,}\/news/g;
|
||||
const infodetail = /\/information\/[0-9]{0,}\/newdetail/g;
|
||||
const project = /\/information\/[0-9]{0,}\/projects/g;
|
||||
const vip = /\/information\/[0-9]{0,}\/VIP/g;
|
||||
if(pathname === `/information/${deptId}`){
|
||||
const info = /\/zone\/[0-9]{0,}\/news/g;
|
||||
const infodetail = /\/zone\/[0-9]{0,}\/newdetail/g;
|
||||
const project = /\/zone\/[0-9]{0,}\/projects/g;
|
||||
const vip = /\/zone\/[0-9]{0,}\/VIP/g;
|
||||
if(pathname === `/zone/${deptId}`){
|
||||
setKey("1");
|
||||
}
|
||||
else if(project.test(pathname)){
|
||||
|
|
@ -42,7 +42,7 @@ function PublicBanner(props){
|
|||
},[pathname])
|
||||
|
||||
return(
|
||||
<div className="in_banner" style={{backgroundImage:`url(${(data && data.bannerList) || banner})`}}>
|
||||
<div className="in_banner" style={{backgroundImage:`url(${(data && data.bannerList && data.bannerList.split(",")[0]) || banner})`}}>
|
||||
{
|
||||
data &&
|
||||
<div>
|
||||
|
|
@ -52,12 +52,12 @@ function PublicBanner(props){
|
|||
}
|
||||
<div className="bannerMenus">
|
||||
<Menu mode={"horizontal"} selectedKeys={[key]}>
|
||||
<Menu.Item key={"1"}><Link to={`/information/${deptId}`}><img src={Menu1} alt="" width="29px"/>首页</Link></Menu.Item>
|
||||
<Menu.Item key={"2"}><Link to={`/information/${deptId}/projects`}><img src={Menu2} alt="" width="34px"/>开源项目</Link></Menu.Item>
|
||||
<Menu.Item key={"1"}><Link to={`/zone/${deptId}`}><img src={Menu1} alt="" width="29px"/>首页</Link></Menu.Item>
|
||||
<Menu.Item key={"2"}><Link to={`/zone/${deptId}/projects`}><img src={Menu2} alt="" width="34px"/>开源项目</Link></Menu.Item>
|
||||
{/* <Menu.Item key={"3"}><img src={Menu3} alt="" width="33px"/>资源发布</Menu.Item> */}
|
||||
<Menu.Item key={"4"}><Link to={`/information/${deptId}/news`}><img src={Menu4} alt="" width="32px"/>领域资讯</Link></Menu.Item>
|
||||
<Menu.Item key={"4"}><Link to={`/zone/${deptId}/news`}><img src={Menu4} alt="" width="32px"/>领域资讯</Link></Menu.Item>
|
||||
{/* <Menu.Item key={"5"}><img src={Menu5} alt="" width="27px"/>Sig小组</Menu.Item> */}
|
||||
<Menu.Item key={"6"}><Link to={`/information/${deptId}/VIP`}><img src={Menu6} alt="" width="36px"/>专区会员</Link></Menu.Item>
|
||||
<Menu.Item key={"6"}><Link to={`/zone/${deptId}/VIP`}><img src={Menu6} alt="" width="36px"/>专区会员</Link></Menu.Item>
|
||||
{ adminUrl && <Menu.Item key={"7"}><a onClick={()=>{window.location.href=adminUrl}}><img src={Menu7} alt="" width="34px"/>后台管理</a></Menu.Item> }
|
||||
</Menu>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import guideArrow from '../img/guideArrow.png';
|
|||
import { Link } from 'react-router-dom';
|
||||
import shijian from '../img/shijian.png';
|
||||
import axios from 'axios';
|
||||
import Nodata from '../../Nodata';
|
||||
|
||||
function HeaderPage(props){
|
||||
const [ projectList , setProjectList ] = useState(undefined);
|
||||
|
|
@ -64,21 +65,21 @@ function HeaderPage(props){
|
|||
}
|
||||
</div>
|
||||
}
|
||||
<div className="zone_news">
|
||||
<p className="in_title mb40">新闻动态</p>
|
||||
{
|
||||
newsList && newsList.length>0 &&
|
||||
{
|
||||
newsList && newsList.length>0 &&
|
||||
<div className="zone_news">
|
||||
<p className="in_title mb40">新闻动态</p>
|
||||
<div className="boxmain" style={{display:"flex"}}>
|
||||
<div className="zone_new_first">
|
||||
<img src={newsList[0].headImg || img1} alt="" height="302px" style={{width:"100%",objectFit:"cover"}} className="mb30"/>
|
||||
<Link to={`/information/${deptId}/newdetail/${newsList[0].id}`} className="zone_n_title task-hide">{newsList[0].name}</Link>
|
||||
<Link to={`/zone/${deptId}/newdetail/${newsList[0].id}`} className="zone_n_title task-hide">{newsList[0].name}</Link>
|
||||
<p className="zone_n_desc task-hide-2">{newsList[0].summary}</p>
|
||||
<p className="font-13 mt10 flexCenter" style={{color:"#8d95a3"}}>
|
||||
<img src={shijian} alt="" className="mr3" />
|
||||
{newsList[0].publishTime}
|
||||
</p>
|
||||
<p className="mt15">
|
||||
<Link to={`/information/${deptId}/newdetail/${newsList[0].id}`} className="color-blue flexCenter zone_btn">查看详情<img src={guideArrow} alt="" width="14px" className="ml3"/></Link>
|
||||
<Link to={`/zone/${deptId}/newdetail/${newsList[0].id}`} className="color-blue flexCenter zone_btn">查看详情<img src={guideArrow} alt="" width="14px" className="ml3"/></Link>
|
||||
</p>
|
||||
</div>
|
||||
<ul className={`zone_new_three ${newsList.length <4 ? "flexStart" : "spaceeTween"}`}>
|
||||
|
|
@ -86,14 +87,14 @@ function HeaderPage(props){
|
|||
newsList.map((i,k)=>{
|
||||
return(
|
||||
k > 0 && <li>
|
||||
<Link className="zone_n_title task-hide" to={`/information/${deptId}/newdetail/${i.id}`}>{i.name}</Link>
|
||||
<Link className="zone_n_title task-hide" to={`/zone/${deptId}/newdetail/${i.id}`}>{i.name}</Link>
|
||||
<p className="zone_n_desc task-hide-2 mt10">{i.summary}</p>
|
||||
<p className="zone_n_value">
|
||||
<span className="font-13" style={{color:"#8d95a3"}}>
|
||||
<img src={shijian} alt="" className="mr3" />
|
||||
{i.publishTime}
|
||||
</span>
|
||||
<Link to={`/information/${deptId}/newdetail/${i.id}`} className="color-blue flexCenter zone_btn">查看详情<img src={guideArrow} alt="" width="14px"/></Link>
|
||||
<Link to={`/zone/${deptId}/newdetail/${i.id}`} className="color-blue flexCenter zone_btn">查看详情<img src={guideArrow} alt="" width="14px"/></Link>
|
||||
</p>
|
||||
</li>
|
||||
)
|
||||
|
|
@ -101,8 +102,8 @@ function HeaderPage(props){
|
|||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div className="zone_projects">
|
||||
<p className="in_title mb40">精选项目</p>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -71,11 +71,11 @@ function Main(props){
|
|||
{
|
||||
mainList && mainList.length>0 &&
|
||||
<Menu mode={"horizontal"} id="menus" selectedKeys={[cateId||"0"]} style={{justifyContent:menuH?"flex-start":"center"}}>
|
||||
<Menu.Item key={"0"}><Link to={`/information/${deptId}/news`}>全部</Link></Menu.Item>
|
||||
<Menu.Item key={"0"}><Link to={`/zone/${deptId}/news`}>全部</Link></Menu.Item>
|
||||
{
|
||||
mainList.map((i,k)=>{
|
||||
return(
|
||||
<Menu.Item key={`${i.id}`}><Link to={`/information/${deptId}/news/${i.id}`}>{i.name}</Link></Menu.Item>
|
||||
<Menu.Item key={`${i.id}`}><Link to={`/zone/${deptId}/news/${i.id}`}>{i.name}</Link></Menu.Item>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
|
@ -101,14 +101,14 @@ function Main(props){
|
|||
<div className="main_card radius4" style={{paddingTop:"25px"}}>
|
||||
<div className="guide">
|
||||
<span className="task-hide">{i.name}</span>
|
||||
{ i.cmsDocList && i.cmsDocList.length> 0 && <Link className="flexCenter" to={`/information/${deptId}/news/${i.id}`} onClick={()=>{window.scrollTo(0,400)}}>更多<img src={guideArrow} alt="" width="14px"/></Link> }
|
||||
{ i.cmsDocList && i.cmsDocList.length> 0 && <Link className="flexCenter" to={`/zone/${deptId}/news/${i.id}`} onClick={()=>{window.scrollTo(0,400)}}>更多<img src={guideArrow} alt="" width="14px"/></Link> }
|
||||
</div>
|
||||
<div>
|
||||
{
|
||||
i.cmsDocList && i.cmsDocList.length>0 ?
|
||||
i.cmsDocList.map((j,e)=>{
|
||||
return(
|
||||
<div className="main_card_item" onClick={()=>{props.history.push(`/information/${deptId}/newdetail/${j.id}`)}}>
|
||||
<div className="main_card_item" onClick={()=>{props.history.push(`/zone/${deptId}/newdetail/${j.id}`)}}>
|
||||
{e===0 &&
|
||||
(
|
||||
j.headImg ?
|
||||
|
|
@ -118,7 +118,7 @@ function Main(props){
|
|||
)
|
||||
}
|
||||
<div style={{flex:1,width:0}}>
|
||||
<Link to={`/information/${deptId}/newdetail/${j.id}`} className={`sub_name task-hide ${e===0? "":"sub_i"}`}>{j.name}</Link>
|
||||
<Link to={`/zone/${deptId}/newdetail/${j.id}`} className={`sub_name task-hide ${e===0? "":"sub_i"}`}>{j.name}</Link>
|
||||
<p className={`sub_desc ${e===0? "task-hide-2":"task-hide"}`}>
|
||||
{j.summary}
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ function NewsDetail(props){
|
|||
detail &&
|
||||
<div style={{width:'1200px',margin:"0px auto",padding:"30px 0px"}}>
|
||||
<Breadcrumb separator=">">
|
||||
<Breadcrumb.Item href={`/information/${deptId}/news`}>领域资讯</Breadcrumb.Item>
|
||||
{ cmsDir && <Breadcrumb.Item href={`/information/${deptId}/news/${cmsDir.id}`}>{cmsDir.name}</Breadcrumb.Item> }
|
||||
<Breadcrumb.Item href={`/zone/${deptId}/news`}>领域资讯</Breadcrumb.Item>
|
||||
{ cmsDir && <Breadcrumb.Item href={`/zone/${deptId}/news/${cmsDir.id}`}>{cmsDir.name}</Breadcrumb.Item> }
|
||||
<Breadcrumb.Item>正文</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
<div className="info_text">
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ function NewsList(props){
|
|||
// <div className="info_news_list">
|
||||
// <div style={{width:'1200px',margin:"0px auto",padding:"30px 0px"}}>
|
||||
// <Breadcrumb separator=">">
|
||||
// <Breadcrumb.Item href={`/information/${deptId}/news`}>领域资讯</Breadcrumb.Item>
|
||||
// <Breadcrumb.Item href={`/zone/${deptId}/news`}>领域资讯</Breadcrumb.Item>
|
||||
// <Breadcrumb.Item>{details && details.name}</Breadcrumb.Item>
|
||||
// </Breadcrumb>
|
||||
// <p className="in_title mb30">{details && details.name}</p>
|
||||
|
|
@ -113,7 +113,7 @@ function NewsList(props){
|
|||
// {
|
||||
// columnList.map((i,k)=>{
|
||||
// return(
|
||||
// <Menu.Item key={i.id} value={i.id} ><Tooltip placement={'left'} title={i.name}><Link className="task-hide" onClick={()=>{if(document.documentElement.scrollTop > 600)window.scrollTo(0,480);}} to={`/information/${deptId}/news/${i.id}`} title={i.name}>{i.name}</Link></Tooltip></Menu.Item>
|
||||
// <Menu.Item key={i.id} value={i.id} ><Tooltip placement={'left'} title={i.name}><Link className="task-hide" onClick={()=>{if(document.documentElement.scrollTop > 600)window.scrollTo(0,480);}} to={`/zone/${deptId}/news/${i.id}`} title={i.name}>{i.name}</Link></Tooltip></Menu.Item>
|
||||
// )
|
||||
// })
|
||||
// }
|
||||
|
|
@ -129,7 +129,7 @@ function NewsList(props){
|
|||
mainList && mainList.length>0 &&
|
||||
mainList.map((i,k)=>{
|
||||
return(
|
||||
<div className="main_card_item" onClick={()=>{props.history.push(`/information/${deptId}/newdetail/${i.id}`)}} key={k}>
|
||||
<div className="main_card_item" onClick={()=>{props.history.push(`/zone/${deptId}/newdetail/${i.id}`)}} key={k}>
|
||||
{
|
||||
i.headImg ?
|
||||
<img src={i.headImg} alt=""/>
|
||||
|
|
@ -137,7 +137,7 @@ function NewsList(props){
|
|||
<DefaultImg name="GitLink" title={details && details.name} />
|
||||
}
|
||||
<div style={{flex:1,width:0}}>
|
||||
<Link to={`/information/${deptId}/newdetail/${i.id}`} className={`sub_name task-hide`}>{i.name}</Link>
|
||||
<Link to={`/zone/${deptId}/newdetail/${i.id}`} className={`sub_name task-hide`}>{i.name}</Link>
|
||||
<p className={`sub_desc task-hide-2`}>
|
||||
{i.summary}
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -105,37 +105,37 @@ function Index(props){
|
|||
<PublicBanner {...props} data={data} adminUrl={adminUrl}/>
|
||||
<Switch>
|
||||
<Route
|
||||
path="/information/:deptId/news/:cateId"
|
||||
path="/zone/:deptId/news/:cateId"
|
||||
render={(p) => (
|
||||
<Main {...props} {...p}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/information/:deptId/newdetail/:id"
|
||||
path="/zone/:deptId/newdetail/:id"
|
||||
render={(p) => (
|
||||
<NewsDetail {...props} {...p}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/information/:deptId/VIP"
|
||||
path="/zone/:deptId/VIP"
|
||||
render={(p) => (
|
||||
<VIP {...props} {...p}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/information/:deptId/projects"
|
||||
path="/zone/:deptId/projects"
|
||||
render={(p) => (
|
||||
<ProjectSource {...props} {...p}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/information/:deptId/news"
|
||||
path="/zone/:deptId/news"
|
||||
render={(p) => (
|
||||
<Main {...props} {...p}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/information/:deptId"
|
||||
path="/zone/:deptId"
|
||||
render={(p) => (
|
||||
<HeaderPage {...props} {...p} data={data}/>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Reference in New Issue