diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 180379579..4eb3c41ed 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -17,7 +17,7 @@ const TerserWebpackPlugin = require('terser-webpack-plugin'); const paths = require("./paths"); const getClientEnvironment = require("./env"); -let publicPath = "/react/build/"; +let publicPath = "/build/"; const publicUrl = publicPath.slice(0, -1); // const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false"; diff --git a/src/App.js b/src/App.js index 43d0c1424..13a1f85fa 100644 --- a/src/App.js +++ b/src/App.js @@ -170,7 +170,6 @@ const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "s class App extends Component { constructor(props) { super(props); - console.log("base:",props.projectBase && props.projectBase.author && props.projectBase.author.type); this.state = { Addcoursestype: false, Addcoursestypes: false, @@ -219,7 +218,6 @@ class App extends Component { let url = `/owners/${pathname}.json`; axios.get(url).then((response) => { if (response && response.status === 200) { - console.log("data:",response.data.type); this.setState({ pathType: response.data.type || '404', pathName: pathname, @@ -337,7 +335,6 @@ class App extends Component { render() { const { pathType, pathName, mygetHelmetapi } = this.state; - console.log("pathType:",pathType); return ( diff --git a/src/forge/Dataset/Index.jsx b/src/forge/Dataset/Index.jsx index 070bb57cb..53b667a25 100644 --- a/src/forge/Dataset/Index.jsx +++ b/src/forge/Dataset/Index.jsx @@ -75,7 +75,7 @@ function Index(props){ key:3, width:"10%", render:(value,item)=>{ - return + return } }, { diff --git a/src/forge/Information/Pages/main.jsx b/src/forge/Information/Pages/main.jsx index 60d3fd758..ff5659fcd 100644 --- a/src/forge/Information/Pages/main.jsx +++ b/src/forge/Information/Pages/main.jsx @@ -85,7 +85,7 @@ function Main(props){ setMainList(rows); // 隐藏判断原因:首页查看全部跳转过来后要默认选择指定的cateID而不是第一个 // if (temp !== tempEnum.zone) { - selectCate(cateId) + selectCate(cateId || (rows[0] && rows[0].id)) // } setIsSpin(false); } diff --git a/src/forge/Information/Pages/newsList.jsx b/src/forge/Information/Pages/newsList.jsx index 67a84e154..47278e649 100644 --- a/src/forge/Information/Pages/newsList.jsx +++ b/src/forge/Information/Pages/newsList.jsx @@ -25,7 +25,6 @@ function NewsList(props){ const [ menuSpin , setMenuSpin ] = useState(true); const { id, temp } = props; - useEffect(()=>{ if(id && cateId ){ setMenuSpin(true); diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 250451864..60e46b773 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -227,6 +227,24 @@ class Detail extends Component { } } + + componentDidUpdate = async (prevState) => { + let prevParam = prevState.match.params; + let propsParam = this.props.match.params; + if (prevState && this.props && (prevParam.projectsId !== propsParam.projectsId || prevParam.owner !== propsParam.owner)) { + const { projectsId, owner } = this.props.match.params; + const data = await getProjectFunc(owner, projectsId); + if (data.data) { + this.getProject(data.data) + } + } + + this.props.history.listen((history) => { + // 非issue链接地址清除cookie states,具体保存和操作在order.js页面 + this.clearIssueCookies(history); + }) + } + clearIssueCookies = (history) => { const { pathname } = history; const { projectsId, owner } = this.props.match.params; @@ -237,9 +255,7 @@ class Detail extends Component { } } async componentWillMount() { - const { projectsId, owner } = this.props.match.params; - console.log(this.props); if (!this.props.projectBase) { const data = await getProjectFunc(owner, projectsId); if (data && data.data) { @@ -517,12 +533,13 @@ class Detail extends Component { const url = `/${owner}/${projectsId}/forks.json`; axios.post(url).then(result => { if (result && result.data.status === 0) { - if (result.data.message === "fork失败,你已拥有了这个项目") { - this.props.history.push(`/${current_user && current_user.login}/${projectsId}`); + this.props.showNotification(result.data.message); + if (result.data.message && result.data.message.indexOf("fork失败")>-1) { + // this.props.history.push(`/${current_user && current_user.login}/${projectsId}`); return; } this.props.history.push(`/${current_user && current_user.login}/${result.data.identifier}`); - this.props.showNotification(result.data.message); + this.props.showNpsModal("indexProject", 3); } this.setState({ @@ -740,7 +757,8 @@ class Detail extends Component { } - + {/* mirror_status = 1的情况不显示项目详情子模块 */} + {!firstSync && {/* 服务 */} } > - + } ) diff --git a/src/forge/Server/List.jsx b/src/forge/Server/List.jsx index e5cd281a0..5dc33711f 100644 --- a/src/forge/Server/List.jsx +++ b/src/forge/Server/List.jsx @@ -19,7 +19,8 @@ function Main(props){ useEffect(()=>{ if(current_user && !current_user.login){ - props.history.push(`/login?go_page=/${owner}/${projectsId}/service`); + // 未登录用户访问会跳转到代码库主页,此处不用处理 + // props.history.push(`/login?go_page=/${owner}/${projectsId}/service`); }else{ setHas_trace_user(current_user.has_trace_user); } diff --git a/src/forge/users/Index.jsx b/src/forge/users/Index.jsx index d0631a393..9ad571647 100644 --- a/src/forge/users/Index.jsx +++ b/src/forge/users/Index.jsx @@ -21,7 +21,6 @@ const Infos = Loadable({ class DetailTop extends Component { constructor(props) { super(props); - console.log("userinfos:",props); this.state = {} } render() {