mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix vditor upload in other pages (#329)
This commit is contained in:
1 parent
76984d985c
commit
628af620bb
1 file changed
+2
-1
@@ -162,6 +162,7 @@ export default class Editor extends DOMAttachedObject {
|
||||
|
||||
async initVditor() {
|
||||
const pagename = document.documentElement.getAttribute('data-page');
|
||||
const isProblemPage = ['problem_create', 'problem_edit'].includes(pagename);
|
||||
const isProblemEdit = pagename === 'problem_edit';
|
||||
const { default: Vditor } = await import('vditor');
|
||||
const { $dom } = this;
|
||||
@@ -209,7 +210,7 @@ export default class Editor extends DOMAttachedObject {
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
this.vditor.insertValue(`${wrapper.join(`file://${filename}`)} `);
|
||||
this.vditor.insertValue(`${wrapper.join(`${isProblemPage ? 'file://' : `/file/${UserContext._id}/`}${filename}`)} `);
|
||||
this.vditor.vditor.tip.hide();
|
||||
})
|
||||
.catch((e: { message: string; }) => {
|
||||
|
||||
Reference in new issue
Block a user