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..a41d43003 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,8 @@ 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 str = search.get("str") || '';
const [wikiPageInitDetail, setWikiPageInitDetail] = useState({})
const [checkItem, setCheckItem] = useState({});
@@ -24,12 +26,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 +52,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: str,
+ sha
}).then(res => {
if(res && res.code === 200){
setItemDetail(res.data);
@@ -71,23 +76,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/services/project.js b/src/services/project.js
index 1aa9345f1..ea2f62e5a 100644
--- a/src/services/project.js
+++ b/src/services/project.js
@@ -15,13 +15,13 @@ const axiosInstance = axios.create({
});
axiosInstance.interceptors.request.use(
config => {
- if (window.location.port === "3007") {
- if (config.url.indexOf('?') === -1) {
- config.url = `${config.url}?debug=admin`;
- } else {
- config.url = `${config.url}&debug=admin`;
- }
- }
+ // if (window.location.port === "3007") {
+ // if (config.url.indexOf('?') === -1) {
+ // config.url = `${config.url}?debug=admin`;
+ // } else {
+ // config.url = `${config.url}&debug=admin`;
+ // }
+ // }
return config;
},
err => {
diff --git a/src/setupProxy.js b/src/setupProxy.js
new file mode 100644
index 000000000..2b1f845c4
--- /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://testgetway.trustie.net/',
+ changeOrigin: true,
+ logLevel: 'debug', // 开启 http-proxy-middleware 的日志
+ // pathRewrite: { '^/api/wiki': '' }, // 根据需要取消注释和修改
+ })
+ );
+
+ app.use(
+ '/api',
+ createProxyMiddleware({
+ target: 'http://testforgeplus.trustie.net/',
+ changeOrigin: true,
+ logLevel: 'debug', // 开启 http-proxy-middleware 的日志
+ // pathRewrite: { '^/api': '' }, // 根据需要取消注释和修改
+ })
+ );
+};
diff --git a/src/ssrUrl.js b/src/ssrUrl.js
index 4bf99bf81..05df5203e 100644
--- a/src/ssrUrl.js
+++ b/src/ssrUrl.js
@@ -1,4 +1,4 @@
-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 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'