perf: 优化pdf文件预览

This commit is contained in:
kuaifan 2024-03-07 15:54:26 +08:00
parent 277115a30f
commit 50a1a3147e
6 changed files with 15 additions and 5 deletions

View File

@ -70,7 +70,7 @@ class FileContent extends AbstractModel
'name' => $name, 'name' => $name,
'ext' => $fileExt 'ext' => $fileExt
])); ]));
return Base::fillUrl("online/preview/{$name}?key={$key}"); return Base::fillUrl("online/preview/{$name}?key={$key}&version=" . Base::getVersion() . "&__=" . Base::msecTime());
} }
/** /**

View File

@ -66,6 +66,16 @@ import {MarkdownPreview} from "../store/markdown";
return str return str
}, },
/**
* 预览文件地址
* @param name
* @param key
* @returns {*}
*/
onlinePreviewUrl(name, key) {
return $A.apiUrl(`../online/preview/${name}?key=${key}&version=${window.systemInfo.version}&__=${new Date().getTime()}`)
},
/** /**
* 项目配置模板 * 项目配置模板
* @param project_id * @param project_id

View File

@ -295,7 +295,7 @@ export default {
previewUrl() { previewUrl() {
if (this.isPreview) { if (this.isPreview) {
const {name, key} = this.contentDetail; const {name, key} = this.contentDetail;
return $A.apiUrl(`../online/preview/${name}?key=${key}&version=${window.systemInfo.version}`) return $A.onlinePreviewUrl(name, key)
} }
return ''; return '';
}, },

View File

@ -109,7 +109,7 @@ export default {
previewUrl() { previewUrl() {
if (this.isPreview) { if (this.isPreview) {
const {name, key} = this.contentDetail; const {name, key} = this.contentDetail;
return $A.apiUrl(`../online/preview/${name}?key=${key}&version=${window.systemInfo.version}`) return $A.onlinePreviewUrl(name, key)
} }
return ''; return '';
}, },

View File

@ -133,7 +133,7 @@ export default {
previewUrl() { previewUrl() {
const {name, key} = this.msgDetail.content; const {name, key} = this.msgDetail.content;
return $A.apiUrl(`../online/preview/${name}?key=${key}&version=${window.systemInfo.version}`) return $A.onlinePreviewUrl(name, key)
} }
}, },
methods: { methods: {

View File

@ -121,7 +121,7 @@ export default {
previewUrl() { previewUrl() {
const {name, key} = this.fileDetail.content; const {name, key} = this.fileDetail.content;
return $A.apiUrl(`../online/preview/${name}?key=${key}&version=${window.systemInfo.version}`) return $A.onlinePreviewUrl(name, key)
} }
}, },
methods: { methods: {