diff --git a/src/forge/Information/Pages/headerPage.jsx b/src/forge/Information/Pages/headerPage.jsx index 020252ec4..450fa603f 100644 --- a/src/forge/Information/Pages/headerPage.jsx +++ b/src/forge/Information/Pages/headerPage.jsx @@ -11,16 +11,18 @@ function HeaderPage(props){ const [ personList , setPersonList ] = useState(undefined); const [ newsList, setNewsList ] = useState(undefined); const { deptId } = props.match.params; - const { data } = props; + const { data,address } = props; useEffect(()=>{ - getProjectList(); - getNewsList(); - getPersonList(); - },[]) + if(address){ + getProjectList(); + getNewsList(); + getPersonList(); + } + },[address]) function getPersonList(){ - const url = `/zone/open/${deptId}/member/homePageList`; + const url = `${address}/zone/open/${deptId}/member/homePageList`; axios.get(url).then(result=>{ if(result){ setPersonList(result.data.rows); @@ -29,7 +31,7 @@ function HeaderPage(props){ } function getNewsList(){ - const url = `/cms/doc/open/zone/${deptId}/homePageDocList`; + const url = `${address}/cms/doc/open/zone/${deptId}/homePageDocList`; axios.get(url).then(result=>{ if(result){ setNewsList(result.data.rows); @@ -38,7 +40,7 @@ function HeaderPage(props){ } function getProjectList(){ - const url = `/zone/open/${deptId}/project/list`; + const url = `${address}/zone/open/${deptId}/project/list`; axios.get(url,{params:{ isHomepage:1 }}).then(result=>{ @@ -49,28 +51,28 @@ function HeaderPage(props){ } return(
-

{data && data.firstTitle}

-
- { - data && -
-

{data.introductionTitle}

-

{data.introductionContent}

-
- } - { - data && data.introductionImage && - - } -
+ {data &&

{data.firstTitle}

} + { + data && (data.introductionTitle || data.introductionContent || data.introductionImage) && +
+
+

{data.introductionTitle}

+

{data.introductionContent}

+
+ { + data.introductionImage && + + } +
+ }

新闻动态

{ newsList && newsList.length>0 &&
- -

{newsList[0].name}

+ + {newsList[0].name}

{newsList[0].summary}

@@ -113,7 +115,7 @@ function HeaderPage(props){

  • {i.projectProperties && i.projectProperties.authorImageUrl && }
  • diff --git a/src/forge/Information/Pages/main.jsx b/src/forge/Information/Pages/main.jsx index 0b529f7d1..bff930efc 100644 --- a/src/forge/Information/Pages/main.jsx +++ b/src/forge/Information/Pages/main.jsx @@ -18,18 +18,19 @@ function Main(props){ const [ hotList , setHotList ] = useState(undefined); const [ isSpin , setIsSpin ] = useState(true); const { deptId } = props.match.params; + const { address } = props; useEffect(()=>{ - if(deptId) { + if(deptId && address) { setIsSpin(true); getMainList(); getHotList(); } - },[deptId]) + },[deptId, address]) function getMainList(){ - const url = `/cms/doc/open/zone/${deptId}/docOverviewList`; + const url = `${address}/cms/doc/open/zone/${deptId}/docOverviewList`; axios.get(url,{ params:{ pageSize:10,pageNum:1 @@ -43,7 +44,7 @@ function Main(props){ } function getHotList(){ - const url = `/cms/doc/open/zone/${deptId}/hotDocList`; + const url = `${address}/cms/doc/open/zone/${deptId}/hotDocList`; axios.get(url,{ params:{pageSize:15,pageNum:1} }).then(result=>{ @@ -56,21 +57,9 @@ function Main(props){ function clickTab(k,idName){ setKey(k); } - // const hash = props.history.location.hash; - - // useEffect(()=>{ - // if(hash){ - // setTimeout(()=>{ - // let top =document.documentElement.scrollTop; - // console.log(document.documentElement.scrollTop); - // window.scrollTo(0,top-120); - // },50) - // } - // },[hash]) return(
    - {/* */}

    领域资讯

    @@ -100,7 +89,7 @@ function Main(props){ return(
    - {i.name} + {i.name} 更多
    @@ -109,7 +98,7 @@ function Main(props){ {i.cmsDocList.map((j,e)=>{ return( -
    +
    {props.history.push(`/information/${deptId}/newdetail/${j.id}`)}}> {e===0 && ( j.headImg ? diff --git a/src/forge/Information/Pages/newsDetail.jsx b/src/forge/Information/Pages/newsDetail.jsx index 2fe7f6476..7ddac2101 100644 --- a/src/forge/Information/Pages/newsDetail.jsx +++ b/src/forge/Information/Pages/newsDetail.jsx @@ -10,15 +10,16 @@ function NewsDetail(props){ const { deptId , id } = props.match.params; const [ detail , setDetail ] = useState(undefined); const [ cmsDir , setCmsDir ] = useState(undefined); + const { address } = props; useEffect(()=>{ - if(id){ + if(id && address){ getDetails(); } - },[id]) + },[id,address]) function getDetails(){ - const url = `/cms/doc/open/${id}`; + const url = `${address}/cms/doc/open/${id}`; axios.get(url).then(result=>{ if(result){ let data = result.data.data; diff --git a/src/forge/Information/Pages/newsList.jsx b/src/forge/Information/Pages/newsList.jsx index 4b66991f1..c1a3ced7a 100644 --- a/src/forge/Information/Pages/newsList.jsx +++ b/src/forge/Information/Pages/newsList.jsx @@ -20,13 +20,14 @@ function NewsList(props){ const [ mainList , setMainList ] = useState(undefined); const [ details , setDetails ] = useState(undefined); const [ menuSpin , setMenuSpin ] = useState(true); + const { address } = props; useEffect(()=>{ - if(deptId && cateId){ + if(deptId && cateId && address){ getMainList(); } - },[deptId,cateId,pageNum]) + },[deptId,cateId,pageNum,address]) @@ -41,7 +42,7 @@ function NewsList(props){ },[deptId,cateId]) function getColumnDetail(){ - const url = `/cms/doc/open/dir/${cateId}`; + const url = `${address}/cms/doc/open/dir/${cateId}`; axios.get(url).then(result=>{ if(result){ setDetails(result.data.data); @@ -50,7 +51,7 @@ function NewsList(props){ } function getColumnList(){ - const url = `/cms/doc/open/zone/${deptId}/dirList`; + const url = `${address}/cms/doc/open/zone/${deptId}/dirList`; axios.get(url).then(result=>{ if(result){ setColumnList(result.data.rows); @@ -61,7 +62,7 @@ function NewsList(props){ } function getMainList(){ - const url = `/cms/doc/open/dir/${cateId}/docList`; + const url = `${address}/cms/doc/open/dir/${cateId}/docList`; axios.get(url,{ params:{ pageNum,pageSize @@ -75,7 +76,7 @@ function NewsList(props){ } function getHotList(){ - const url = `/cms/doc/open/dir/${cateId}/hotDocList`; + const url = `${address}/cms/doc/open/dir/${cateId}/hotDocList`; axios.get(url,{ params:{ pageNum:1,pageSize:15 @@ -120,7 +121,7 @@ function NewsList(props){ mainList && mainList.length>0 ? mainList.map((i,k)=>{ return( -
    +
    {props.history.push(`/information/${deptId}/newdetail/${i.id}`)}} key={k}> { i.headImg ? diff --git a/src/forge/Information/Pages/projectSource.jsx b/src/forge/Information/Pages/projectSource.jsx index f8dadea28..4fbdee588 100644 --- a/src/forge/Information/Pages/projectSource.jsx +++ b/src/forge/Information/Pages/projectSource.jsx @@ -18,22 +18,23 @@ function ProjectSource(props){ const [ searchName , setSearchName ] = useState(undefined); const [ value , setValue ] = useState(undefined); const [ loading , setLoading ] = useState(false); + const { address} = props; useEffect(()=>{ - if(deptId){ + if(deptId && address){ getTypeList(); } - },[deptId]) + },[deptId,address]) useEffect(()=>{ - if(deptId){ + if(deptId && address){ setLoading(true); getLists(); } - },[deptId,typeId,page,searchName]) + },[deptId,address,typeId,page,searchName]) function getLists(){ - const url = `/zone/open/${deptId}/project/list`; + const url = `${address}/zone/open/${deptId}/project/list`; axios.get(url,{ params:{ pageNum:page, @@ -52,7 +53,7 @@ function ProjectSource(props){ function getTypeList(){ - const url = `/zone/open/${deptId}/projectType/list`; + const url = `${address}/zone/open/${deptId}/projectType/list`; axios.get(url).then(result=>{ if(result){ setTypeList(result.data.rows); diff --git a/src/forge/Information/Pages/zoneVIP.jsx b/src/forge/Information/Pages/zoneVIP.jsx index 1048f1d04..59efdaf27 100644 --- a/src/forge/Information/Pages/zoneVIP.jsx +++ b/src/forge/Information/Pages/zoneVIP.jsx @@ -9,16 +9,17 @@ function ZoneVIP(props){ const { deptId } = props.match.params; const [ vipLists , setVIPLists ] = useState(undefined); const [ isSpin , setIsSpin ] = useState(true); + const { address } = props; useEffect(()=>{ - if(deptId){ + if(deptId && address){ setIsSpin(true); getLists(); } - },[deptId]) + },[deptId , address]) function getLists(){ - const url = `/zone/open/${deptId}/member/overviewList`; + const url = `${address}/zone/open/${deptId}/member/overviewList`; axios.get(url).then(response=>{ if(response){ setVIPLists(response.data.rows); diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index 45bbec818..179d20505 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -10,7 +10,6 @@ import Loadable from "react-loadable"; import Loading from "../../Loading"; import axios from 'axios'; import PublicBanner from "./Component/publicBanner"; -import { isDev } from 'educoder'; import './index.scss'; const VIP = Loadable({ @@ -40,37 +39,47 @@ const Main = Loadable({ function Index(props){ const [ data , setData ] = useState(undefined); const [ adminUrl , setAdminUrl ] = useState(undefined); + const [ address , setAddress ] = useState(""); const { deptId } = props.match.params; + const isDev = window.location.port === '3007' || window.location.origin === "https://testforgeplus.trustie.net"; + console.log(isDev,window.location); useEffect(()=>{ - axios.interceptors.request.use( - config => { - var localproxy = "https://testgetway.trustie.net"; - var proxy = ""; - let url = "/api" +config.url; - if(isDev){ - url = localproxy + url ; - }else{ - url = proxy + url; - } - config.url =url; - return config; - }, - err => { - return Promise.reject(err); - } - ) + const isDev = window.location.port === '3007' || window.location.origin === "https://testforgeplus.trustie.net"; + console.log(isDev,window.location.hostname); + if(isDev === true){ + setAddress("https://testgetway.trustie.net/api"); + }else{ + setAddress("https://gateway.gitlink.org.cn/api"); + } + // axios.interceptors.request.use( + // config => { + // var localproxy = "https://testgetway.trustie.net"; + // var proxy = ""; + // let url = "/api" +config.url; + // if(isDev){ + // url = localproxy + url ; + // }else{ + // url = proxy + url; + // } + // config.url =url; + // return config; + // }, + // err => { + // return Promise.reject(err); + // } + // ) },[]) useEffect(()=>{ - if(deptId){ + if(deptId && address){ getDetail(); getAdminUrl(); } - },[deptId]) + },[deptId,address]) function getAdminUrl(){ - const url = `/zone/zoneDetail/${deptId}/checkZoneRole`; + const url = `${address}/zone/zoneDetail/${deptId}/checkZoneRole`; axios.get(url).then(response=>{ if(response && response.data.code === 200){ setAdminUrl(response.data.data); @@ -81,7 +90,7 @@ function Index(props){ } function getDetail(){ - const url = `/zone/open/${deptId}`; + const url = `${address}/zone/open/${deptId}`; axios.get(url).then(result=>{ if(result){ let data = result.data.data; @@ -92,42 +101,42 @@ function Index(props){ } return(
    - + ( - + )} > ( - + )} > ( - + )} > ( - + )} > ( -
    +
    )} > ( - + )} > diff --git a/src/forge/Information/index.scss b/src/forge/Information/index.scss index 9baf42b53..428f6bf23 100644 --- a/src/forge/Information/index.scss +++ b/src/forge/Information/index.scss @@ -176,6 +176,7 @@ display: flex; padding:24px 0px; border-bottom: 1px solid rgba(170, 175, 190, 0.15); + cursor: pointer; &:last-child{ border-bottom: none; } @@ -220,6 +221,9 @@ display: block; line-height: 25px; word-break: break-all; + &:hover{ + color: #466aff; + } &.sub_i{ padding-left: 18px; &::before{ @@ -244,14 +248,17 @@ margin-bottom: 5px; &>span{ display: block; - width: 113px; + width: auto; + min-width: 112px; + max-width: 480px; height: 30px; line-height: 30px; - padding-left: 9px; + padding:0px 13px 0px 8px; color: #fff; font-size:17px; background-image: url(./img/guide.png); background-size: 100% 100%; + background-repeat: no-repeat; span{ display: block; max-width: 100px; @@ -606,6 +613,7 @@ font-size:17px; height: 24px; line-height: 24px; + display: block; &:hover{ color: #466aff; } @@ -647,6 +655,7 @@ padding:30px; flex:1; border-radius: 4px; + width: 0; } .zone_new_three{ margin-left: 30px; @@ -708,6 +717,7 @@ } .infoBox{ flex:1; + width: 0; .z_p_title{ font-weight:700; color:#1f2329;