#I9FSZ3 解决导出word没有图片的问题
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
ENV = 'development'
|
||||
|
||||
# base api
|
||||
VITE_APP_BASE_API = 'http://local.zyplayer.com:8083/zyplayer-doc'
|
||||
VITE_APP_BASE_API = 'http://local.zyplayer.com:8083'
|
||||
# VITE_APP_BASE_API = 'http://zyplayer.com'
|
||||
|
||||
|
||||
|
||||
21
zyplayer-doc-ui/wiki-ui/src/assets/api/hostUtils.js
Normal file
21
zyplayer-doc-ui/wiki-ui/src/assets/api/hostUtils.js
Normal file
@@ -0,0 +1,21 @@
|
||||
let baseApi = import.meta.env.VITE_APP_BASE_API;
|
||||
|
||||
export function fixRequestUrl(url) {
|
||||
return fixTwoUrl(baseApi, url);
|
||||
}
|
||||
|
||||
export function fixTwoUrl(url1, url2) {
|
||||
if (!url1 || !url2) {
|
||||
if (!url1 && !url2) {
|
||||
return '';
|
||||
}
|
||||
return url1 || url2;
|
||||
}
|
||||
if (url1.endsWith('/') && url2.startsWith('/')) {
|
||||
return url1 + url2.substring(1);
|
||||
}
|
||||
if (!url1.endsWith('/') && !url2.startsWith('/')) {
|
||||
return url1 + '/' + url2;
|
||||
}
|
||||
return url1 + url2;
|
||||
}
|
||||
@@ -95,6 +95,7 @@ import PageAuthDialog from '@/views/page/show/PageAuthDialog.vue'
|
||||
import MobileQrScanDialog from '@/views/page/show/MobileQrScanDialog.vue'
|
||||
import AboutDialog from "@/views/common/AboutDialog.vue"
|
||||
import UserMessagePopover from "./UserMessagePopover.vue"
|
||||
import {fixRequestUrl} from "@/assets/api/hostUtils";
|
||||
|
||||
let router = useRouter();
|
||||
let storePage = useStorePageData();
|
||||
@@ -177,9 +178,14 @@ const deleteWikiPage = () => {
|
||||
}
|
||||
// 下载为Word
|
||||
let downloadFormRef = ref();
|
||||
let downloadFormParam = ref({url: 'zyplayer-doc-wiki/page/download', param: {}});
|
||||
let downloadFormParam = ref({url: fixRequestUrl('zyplayer-doc-wiki/page/download'), param: {}});
|
||||
const exportWord = () => {
|
||||
downloadFormParam.value.param = {pageId: storePage.pageInfo.id};
|
||||
let pageViewContent = document.getElementById('pageContentBox');
|
||||
let innerHtml = pageViewContent.innerHTML || '';
|
||||
downloadFormParam.value.param = {
|
||||
pageId: storePage.pageInfo.id,
|
||||
content: innerHtml,
|
||||
};
|
||||
setTimeout(() => downloadFormRef.value.submit(), 0);
|
||||
}
|
||||
// 手机扫码
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<el-col :span="navigationList.length > 0 ? 18 : 24">
|
||||
<div style="max-width: 1000px; margin: 0 auto; padding-left: 10px">
|
||||
<div class="wiki-title" ref="wikiTitleRef">{{ storePage.pageInfo.name }}</div>
|
||||
<div ref="pageContentRef" class="wiki-page-content">
|
||||
<div id="pageContentBox" ref="pageContentRef" class="wiki-page-content">
|
||||
<div v-html="pageShowDetail" class="markdown-body" v-if="wikiPage.editorType == 2" v-highlight></div>
|
||||
<div v-html="pageShowDetail" class="wang-editor-body" v-else></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user