fix:开源仓嵌入方式
Context testing / dump_contexts_to_log (push) Successful in 1m34s Details
Context testing / run-02 (push) Successful in 4m7s Details
Context testing / run-01 (push) Successful in 4m9s Details
Context testing / run-04 (push) Successful in 5m2s Details
Context testing / run-03 (push) Successful in 5m6s Details

This commit is contained in:
liuhengshu 2026-07-31 09:26:39 +08:00
parent 6409ad6940
commit 87bc88600e
5 changed files with 51 additions and 6 deletions

View File

@ -56,4 +56,4 @@ export const deepRoutes = [
]
// 不进行组织或个人判断
export const specialRoute = ["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", "undefined", "admins", "oauth", "competitions", "hiagent","sf", "development", "governance"]
export const specialRoute = ["ossRepo", "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", "undefined", "admins", "oauth", "competitions", "hiagent","sf", "development", "governance","explore"]

View File

@ -236,6 +236,11 @@ const GovernanceIframe = Loadable({
loading: Loading,
});
const OssRepoIframe = Loadable({
loader: () => import("./forge/ossRepoIframe"),
loading: Loading,
});
const Forums = Loadable({
loader: () => import("./forums"),
loading: Loading,
@ -252,7 +257,7 @@ const AI = 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","zone", "hiagent","sf", "development", "governance", "forums", "news", "exploreStore", "factory", "zoneAdmin", "ai"];
const keyWord = ["ossRepo", "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", "hiagent","sf", "development", "governance", "explore","forums", "news", "exploreStore", "factory", "zoneAdmin", "ai"];
class App extends Component {
constructor(props) {
@ -636,7 +641,7 @@ class App extends Component {
<Route path="/search" component={Search} mygetHelmetapi={mygetHelmetapi} />
{/* 项目标签列表页 */}
<Route path="/explore/topic/:id/:name" component={Topic} mygetHelmetapi={mygetHelmetapi} />
<Route path="/ossRepo/topic/:id/:name" component={Topic} mygetHelmetapi={mygetHelmetapi} />
<Route path={"/:OIdentifier/enterprise"}
render={
@ -723,7 +728,7 @@ class App extends Component {
<Projects {...this.props} {...props} />
)}
></Route>
<Route exact path="/explore"
<Route exact path="/ossRepo"
render={
(props) => (
<Projects {...this.props} {...props} {...this.state}/>
@ -745,6 +750,15 @@ class App extends Component {
}>
</Route>
<Route
path={"/explore"}
render={
(props) => {
return (<OssRepoIframe {...this.props} {...props} {...this.state} />)
}
}>
</Route>
<Route
path={"/factory"}
render={

View File

@ -350,7 +350,7 @@ class NewHeader extends Component {
},
{
"name": "开源软件仓库",
"link": "/explore",
"link": "/ossRepo",
"index": "2",
"hidden": false
},

View File

@ -72,7 +72,7 @@ class Index extends Component {
></Route>
<Route
path="/explore"
path="/ossRepo"
render={(props) => (
<ProjectHome {...this.props} {...props} />
)}

View File

@ -0,0 +1,31 @@
import React, { useEffect, useState } from "react";
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
import loadingGIf from "./Images/loading.gif";
function OssRepo(props) {
const {current_user, mygetHelmetapi} = props;
const {admin, user_id} = current_user || {}
const {common} = mygetHelmetapi || {};
const {ossRepo="http://27.122.114.160:3001"} = common || {};
const [loading, setLoading] = useState(true);
useEffect(()=>{
document.title = '开源软件仓库';
// document.body.style.background = '#fff';
return () => {
document.body.style.background = '';
}
}, [])
const url = `${ossRepo}/?uid=${user_id === 2 ? undefined : user_id}`
// const url = "http://localhost:3007/"
return <div className="" style={{border: "none"}}>
{loading && <div className="center" style={{minHeight: '60vh', marginTop: '30vh'}}>
<img src={loadingGIf} width={250}/>
<div className="font-16" style={{position: 'relative', top: '-40px', color: '#091221', opacity: '0.6'}}>加载中请耐心等待</div>
</div>}
<iframe title={`ossRepoIframe`} src={url} id={`ossRepoIframe`} frameBorder="0" name={`ossRepoIframe`} width="100%" style={{height: '100vh', border: 'none'}} onLoad={()=>{setLoading(false)}}></iframe>
</div>
}
export default TPMIndexHOC(OssRepo);