forked from Gitlink/forgeplus-react
导入项目失败后404 解决方案2
This commit is contained in:
parent
eb664330b2
commit
08f271a1c2
|
|
@ -82,13 +82,6 @@ export function initAxiosInterceptors(props) {
|
|||
}
|
||||
throw new axios.Cancel('Operation canceled by the user.');
|
||||
}
|
||||
if (response.data.status === 403 || response.data.status === "403" || response.data.status === 404) {
|
||||
if(!window.location.pathname.includes('/releases')){
|
||||
locationurl(`/${response.data.status}`);
|
||||
}else{
|
||||
console.log("releases 404了");
|
||||
}
|
||||
}
|
||||
|
||||
if (response.data.status === 403 || response.data.status === "403") {
|
||||
// locationurl('/403');
|
||||
|
|
|
|||
|
|
@ -191,7 +191,8 @@ class Detail extends Component {
|
|||
defaultBranch: undefined,
|
||||
|
||||
// 非本平台项目
|
||||
platform: false
|
||||
platform: false,
|
||||
mirror_status:1
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -255,8 +256,14 @@ class Detail extends Component {
|
|||
secondSync: false
|
||||
})
|
||||
}
|
||||
this.setState({
|
||||
mirror_status:1
|
||||
})
|
||||
} else if (result.data.mirror_status === 2) {
|
||||
this.deleteProjectBack();
|
||||
this.setState({
|
||||
mirror_status:2
|
||||
})
|
||||
} else {
|
||||
this.getBanner();
|
||||
this.getDetail();
|
||||
|
|
@ -527,7 +534,7 @@ class Detail extends Component {
|
|||
const { projectDetail, watchers_count, praises_count,
|
||||
forked_count, firstSync, secondSync,
|
||||
isManager, watched, praised,
|
||||
project, open_devops, platform, defaultBranch, bannerList, forkSpin } = this.state;
|
||||
project, open_devops, platform, defaultBranch, bannerList, forkSpin , mirror_status } = this.state;
|
||||
const url = this.props.history.location.pathname;
|
||||
const urlArr = url.split("/");
|
||||
const urlFlag = (urlArr.length === 3);
|
||||
|
|
@ -753,37 +760,6 @@ class Detail extends Component {
|
|||
(props) => (<OrderMilepost {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 里程碑页面新建任务 */}
|
||||
{/* <Route path="/:owner/:projectsId/issues/:milepostId/new"
|
||||
render={
|
||||
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route> */}
|
||||
{/* 新建任务 */}
|
||||
{/* <Route path="/:owner/:projectsId/issues/new"
|
||||
render={
|
||||
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route> */}
|
||||
{/* 修改详情 edit*/}
|
||||
{/* <Route path="/:owner/:projectsId/issues/:orderId/edit"
|
||||
render={
|
||||
(props) => (<OrderupdateDetail {...this.props} {...props} {...this.state} {...common} form_type={"edit"} />)
|
||||
}
|
||||
></Route> */}
|
||||
{/* 复制详情 copyetail*/}
|
||||
{/* <Route path="/:owner/:projectsId/issues/:orderId/copyetail"
|
||||
render={
|
||||
(props) => (<OrderupdateDetail {...this.props} {...props} {...this.state} {...common} form_type={"copy"} />)
|
||||
}
|
||||
></Route> */}
|
||||
|
||||
{/* 任务详情 */}
|
||||
{/* <Route path="/:owner/:projectsId/issues/:orderId"
|
||||
render={
|
||||
(props) => (<OrderDetail {...this.props} {...this.state} {...props} {...common} />)
|
||||
}
|
||||
></Route> */}
|
||||
{/* 动态 */}
|
||||
<Route path="/:owner/:projectsId/activity"
|
||||
render={
|
||||
|
|
@ -796,12 +772,6 @@ class Detail extends Component {
|
|||
(props) => (<OrderIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 新建合并请求 */}
|
||||
{/* <Route path="/:owner/:projectsId/compare/:branch"
|
||||
render={
|
||||
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
|
||||
}
|
||||
></Route> */}
|
||||
<Route path="/:owner/:projectsId/compare"
|
||||
render={
|
||||
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
|
||||
|
|
@ -818,12 +788,6 @@ class Detail extends Component {
|
|||
(props) => (<Review {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* webIDE */}
|
||||
{/* <Route path="/:owner/:projectsId/webIDE/tree/:branchName"
|
||||
render={
|
||||
(props) => (<WebIDE {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route> */}
|
||||
<Route path="/:owner/:projectsId/pulls/:mergeId"
|
||||
render={
|
||||
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
|
||||
|
|
@ -897,7 +861,7 @@ class Detail extends Component {
|
|||
></Route>
|
||||
<Route path="/:owner/:projectsId"
|
||||
render={
|
||||
(props) => (<CoderDepot {...this.props} {...props} {...this.state} {...common} />)
|
||||
(props) => (mirror_status!==2 ? <CoderDepot {...this.props} {...props} {...this.state} {...common} /> :<Spin />)
|
||||
}
|
||||
></Route>
|
||||
</Switch>
|
||||
|
|
|
|||
Loading…
Reference in New Issue