glcc帮助中心显示内容使用md,无权限用户访问无sidebar的wiki显示问题

This commit is contained in:
谢思 2023-04-04 10:42:57 +08:00
parent 71ff055640
commit c42b119c07
3 changed files with 1126 additions and 1127 deletions

2234
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -83,20 +83,18 @@ export async function parseSidebar(wikiList, info){
wikiList.map(item=>{
wikiArr.push(`[[${item.name}]]`)
});
const wikiSidebarStr = wikiArr.join('\n');
await addWiki({
...info,
pageName: '_Sidebar',
title: '_Sidebar',
message: '',
content_base64: Base64.encode(wikiArr.join('\n'))
}).then(res=>{
if(res && res.message === "201"){
ReInfo={
menuList: markdownToTree(wikiArr.join('\n')),
sidebar: wikiArr.join('\n')
}
}
content_base64: Base64.encode(wikiSidebarStr)
})
ReInfo={
menuList: markdownToTree(wikiSidebarStr),
sidebar: wikiSidebarStr
}
}
return ReInfo;
}

View File

@ -1,11 +1,12 @@
import { Base64 } from 'js-base64';
import React , { useEffect , useState } from 'react';
import NodataPanel from '../../components/nodata-panel';
import RenderHtml from '../../components/render-html';
import { wikiPages, getWiki } from '../../forge/Wiki/api';
import bg from '../img/help_bg.png';
import './index.scss';
function Help(props) {
const {showNotification} = props;
const {showNotification, history} = props;
const [fileArrInit, setFileArrInit] = useState(null);
const [checkItem, setCheckItem] = useState({});
const [itemDetail, setItemDetail] = useState({});
@ -55,7 +56,7 @@ function Help(props) {
return <span className={`wiki_title font-15 mb15 ${item.name === checkItem.name? 'active' : ''}`} key={item.name} onClick={() => { setCheckItem(item) }}>{item.name}</span>})}
</div>
<div className="help_cntent pt10" >
<div dangerouslySetInnerHTML={{ __html: itemDetail && itemDetail.md_content && Base64.decode(itemDetail.md_content) }}></div>
{itemDetail && itemDetail.md_content && <RenderHtml value={ itemDetail && Base64.decode(itemDetail.md_content) } url={history.location}/>}
<img src={bg} className='bg' alt='bg'/>
</div>
</div>}