diff --git a/src/forge/Wiki/page/index.scss b/src/forge/Wiki/page/index.scss
index 0f98f10ee..92b2e9fef 100644
--- a/src/forge/Wiki/page/index.scss
+++ b/src/forge/Wiki/page/index.scss
@@ -112,7 +112,7 @@
display: flex;
justify-content: space-between;
align-items: center;
- padding: 0 12rem 0 2rem;
+ padding: 0 2rem 0 2rem;
width: 100%;
height: 8vh;
background: rgb(39, 47, 76);
@@ -125,4 +125,26 @@
flex:none
}
}
+}
+.history {
+ .wiki-title {
+ font-weight: 700;
+ color: #202d40;
+ font-size: 17px;
+ }
+ .ant-table-thead > tr > th{
+ background-color: #fff;
+ }
+ .ant-table-column-title {
+ color: #202d40;
+ font-size: 16px;
+ }
+ .divider {
+ opacity: 24%;
+ width: 0px;
+ height: 7px;
+ border-right: 1px solid;
+ border-color: #72748e;
+ display: inline-block;
+ }
}
\ No newline at end of file
diff --git a/src/forge/Wiki/page/preview.jsx b/src/forge/Wiki/page/preview.jsx
index ef859e248..52d391a2d 100644
--- a/src/forge/Wiki/page/preview.jsx
+++ b/src/forge/Wiki/page/preview.jsx
@@ -1,8 +1,8 @@
import React, { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { Base64 } from 'js-base64';
-import { Divider } from 'antd';
-import { getWiki, getMenuListAndSidebarData, findNodeByFirstOrContrastName, } from '../api';
+import { Divider, Button } from 'antd';
+import { getWiki, getMenuListAndSidebarData, findNodeByFirstOrContrastName, getPreviousWiki } from '../api';
import RenderHtml from '../../../components/render-html';
import TreeByWikiSidebar from '../components/treeByWikiSidebar';
import Clone from '../components/clone';
@@ -15,6 +15,7 @@ export default (props) => {
const search = new URLSearchParams(location.search);
const projectName = search.get("name") || '';
const wikiBySearch = search.get("wiki") || '';
+ const sha = search.get("sha") || '';
const [wikiPageInitDetail, setWikiPageInitDetail] = useState({})
const [checkItem, setCheckItem] = useState({});
@@ -24,12 +25,13 @@ export default (props) => {
useEffect(()=>{
if(checkItem && checkItem.name){
- document.title = `${checkItem.name}-维基预览`
+ document.title = `${checkItem.name || wikiBySearch}-维基预览`
}
}, [checkItem])
useEffect(()=>{
+ if (sha) return
// 获取wiki 目录树、sidebar内容
getMenuListAndSidebarData(wikiParams).then(res=>{
setWikiPageInitDetail(res);
@@ -49,11 +51,13 @@ export default (props) => {
setCheckItem(node);
}, [menuList, wikiBySearch])
- useEffect(() => {
- document.title = `${checkItem && checkItem.titleStr}-维基预览`
- checkItem.title_sub && getWiki({
+ useEffect(() => {
+ document.title = `${checkItem && checkItem.titleStr || wikiBySearch}-维基预览`
+ const func = sha ? getPreviousWiki : getWiki
+ func({
...wikiParams,
- pageName: checkItem.title_sub
+ pageName: checkItem.title_sub || wikiBySearch,
+ sha
}).then(res => {
if(res && res.code === 200){
setItemDetail(res.data);
@@ -71,23 +75,35 @@ export default (props) => {
{projectName}
-
克隆地址
-
-
+ {
+ sha ? : <>
+ 克隆地址
+
+
+ >
+ }
-
- {/* 读sidebar转换成目录树 */}
- {
- history.push(`${location.pathname}?name=${projectName}&wiki=${encodeURIComponent(node.titleStr)}`)
- }}/>
-
-
+ {
+ !sha &&
+ {/* 读sidebar转换成目录树 */}
+ {
+ history.push(`${location.pathname}?name=${projectName}&wiki=${encodeURIComponent(node.titleStr)}`)
+ }}/>
+
+ }
+
-
{checkItem.titleStr}
+
{itemDetail.title}
{itemDetail && itemDetail.content_base64 &&
}
diff --git a/src/setupProxy.js b/src/setupProxy.js
new file mode 100644
index 000000000..567aed980
--- /dev/null
+++ b/src/setupProxy.js
@@ -0,0 +1,24 @@
+// src/setupProxy.js
+const { createProxyMiddleware } = require('http-proxy-middleware');
+
+module.exports = function(app) {
+ app.use(
+ '/api/wiki',
+ createProxyMiddleware({
+ target: 'http://172.20.32.201:8000/',
+ changeOrigin: true,
+ logLevel: 'debug', // 开启 http-proxy-middleware 的日志
+ // pathRewrite: { '^/api/wiki': '' }, // 根据需要取消注释和修改
+ })
+ );
+
+ app.use(
+ '/api',
+ createProxyMiddleware({
+ target: 'http://172.20.32.201:4000/',
+ changeOrigin: true,
+ logLevel: 'debug', // 开启 http-proxy-middleware 的日志
+ // pathRewrite: { '^/api': '' }, // 根据需要取消注释和修改
+ })
+ );
+};
diff --git a/src/ssrUrl.js b/src/ssrUrl.js
index 4bf99bf81..df1d4b10e 100644
--- a/src/ssrUrl.js
+++ b/src/ssrUrl.js
@@ -1,4 +1,5 @@
-export const url = process.env.NODE_ENV === 'production' ? 'https://www.gitlink.org.cn' : 'https://testforgeplus.trustie.net'
+// export const url = process.env.NODE_ENV === 'production' ? 'https://www.gitlink.org.cn' : 'https://testforgeplus.trustie.net'
+export const url = process.env.NODE_ENV === 'production' ? 'https://www.gitlink.org.cn' : 'http://172.20.32.201:4000/'
export const zoneUrl = process.env.NODE_ENV === 'production' ? 'https://gateway.gitlink.org.cn' : 'https://testgetway.trustie.net'
export const host = process.env.NODE_ENV === 'production' ? 'www.gitlink.org.cn' : 'testforgeplus.trustie.net'