1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 00:43:53 +00:00

Fix published wiki url when switch to page (#6953)

* delete useless css

* fix URL when switch page in published Wiki
This commit is contained in:
Michael An
2024-10-28 17:24:09 +08:00
committed by GitHub
parent 04bbb9080e
commit 285f98a729
2 changed files with 12 additions and 10 deletions

View File

@@ -10,8 +10,6 @@
}
.detail-body .detail-image-thumbnail .thumbnail {
height: 100%;
width: 100%;
border: 0;
border-radius: 0;
float: none;

View File

@@ -53,14 +53,16 @@ class Wiki extends Component {
this.getWikiConfig();
}
handlePath = () => {
const custom_url = window.location.pathname.substring(1);
if (custom_url.includes('wiki/publish')) {
return custom_url;
getCustomUrl = () => {
const siteRootLen = siteRoot.length;
const customUrl = window.location.pathname.substring(siteRootLen);
if (customUrl.includes('wiki/publish')) {
return customUrl;
}
return isWiki2 ? 'wikis/' : 'published/';
};
getWikiConfig = () => {
let wikiAPIConfig;
if (wikiPermission === 'public') {
@@ -171,11 +173,13 @@ class Wiki extends Component {
const params = new URLSearchParams(window.location.search);
params.set('page_id', pageId);
let fileUrl = `${siteRoot}${this.handlePath()}${wikiId}/?${params.toString()}`;
if (this.handlePath().includes('wiki/publish')) {
fileUrl = `${siteRoot}${this.handlePath()}?${params.toString()}`;
let customUrl = this.getCustomUrl();
let url = `${siteRoot}${customUrl}${wikiId}/?${params.toString()}`;
if (customUrl.includes('wiki/publish')) {
url = `${siteRoot}${customUrl}?${params.toString()}`;
}
window.history.pushState({ url: fileUrl, path: filePath }, filePath, fileUrl);
window.history.pushState({ url: url, path: filePath }, filePath, url);
};
cacheHistoryFiles = (docUuid, name, pageId) => {