From 76a00475a0f805fec5940300e8ccd83b6fae5d69 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com>
Date: Tue, 4 Apr 2023 14:11:15 +0800
Subject: [PATCH] =?UTF-8?q?wiki=E9=9B=86=E6=88=90=E9=94=9A=E7=82=B9?=
=?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 4 ++--
public/index.html | 11 ++++++++++-
src/AppConfig.js | 3 ++-
src/common/marked.js | 3 ++-
src/components/render-html.jsx | 6 +++---
src/forge/Wiki/Index.jsx | 3 ++-
6 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/package.json b/package.json
index 05b987685..4fb713015 100644
--- a/package.json
+++ b/package.json
@@ -222,7 +222,7 @@
"webpack": "^4.42.1",
"webpack-bundle-analyzer": "^3.7.0"
},
- "volta":{
- "node":"8.12.0"
+ "volta": {
+ "node": "8.12.0"
}
}
diff --git a/public/index.html b/public/index.html
index 9a3bbc126..c62221a58 100755
--- a/public/index.html
+++ b/public/index.html
@@ -53,7 +53,16 @@
$('#ie_info').css({display:'block'});
$('#root').css({display:'none'});
}
-
+ window.onload=function(){
+ $(".newContainer").delegate("a.anchors","click",function(){
+ let h = $(this).offset().top - 180;
+ $("html,body").animate({scrollTop:h},10);
+ window.location.hash = $(this).attr("name");
+ return false;
+ });
+
+ }
+
diff --git a/src/AppConfig.js b/src/AppConfig.js
index 6e20bcf28..be1fe7622 100644
--- a/src/AppConfig.js
+++ b/src/AppConfig.js
@@ -33,7 +33,8 @@ export function initAxiosInterceptors(props) {
initOnlineOfflineListener();
// var proxy = "http://192.168.1.40:3000";
- var proxy = "http://111.8.36.180:8000";
+ // var proxy = "http://111.8.36.180:8000";
+ var proxy = "http://117.50.100.12:49999"
// var proxy = "https://www.osredm.com";
//响应前的设置
diff --git a/src/common/marked.js b/src/common/marked.js
index abfd657a0..674b986c5 100644
--- a/src/common/marked.js
+++ b/src/common/marked.js
@@ -155,7 +155,8 @@ renderer.heading = function (text, level, raw) {
level: level,
text: text
})
- return '
]*>/g
+const preRegex = /]*>/g;
function _unescape(str) {
let div = document.createElement('div')
div.innerHTML = str
@@ -46,7 +46,7 @@ export default ({
let id = decodeURIComponent(u.split("#")[1]);
let ele = document.getElementById(id);
if(ele){
- window.scrollTo(0, ele.offsetTop + 120);
+ window.scrollTo(0, ele.offsetTop);
}
}
}
diff --git a/src/forge/Wiki/Index.jsx b/src/forge/Wiki/Index.jsx
index f15b19686..2ac1c6326 100644
--- a/src/forge/Wiki/Index.jsx
+++ b/src/forge/Wiki/Index.jsx
@@ -9,6 +9,7 @@ import { wikiPages, getWiki, deleteWiki } from './api';
import { httpUrl, TokenKey } from './fetch';
import './Index.scss';
import { isArray } from 'lodash';
+import RenderHtml from '../../components/render-html';
const Search = Input.Search;
const InputGroup = Input.Group;
const { Option } = Select;
@@ -271,7 +272,7 @@ export default (props) => {
{permission && }
-
+ {itemDetail && itemDetail.md_content && }