From 6527b3790e844543238be24b8d5673d3d2c9fd2f Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 26 Aug 2025 10:47:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20add=20link=20logo,=20=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E6=96=B0=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend_nuxt/components/MessageFloatWindow.vue | 4 ---- frontend_nuxt/utils/markdown.js | 2 +- frontend_nuxt/utils/vditor.js | 3 ++- frontend_nuxt/utils/vditorPostCitation.js | 6 +++--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/frontend_nuxt/components/MessageFloatWindow.vue b/frontend_nuxt/components/MessageFloatWindow.vue index 6b44ca6d4..fb2495ac7 100644 --- a/frontend_nuxt/components/MessageFloatWindow.vue +++ b/frontend_nuxt/components/MessageFloatWindow.vue @@ -9,14 +9,12 @@ title="收起至 100px" @click="collapseToMini" > - - @@ -61,7 +59,6 @@ function injectBaseTag() { } } -// 当浮窗重新出现时,恢复默认高度 watch( () => floatRoute.value, (v) => { @@ -76,7 +73,6 @@ watch( bottom: 0; right: 0; width: 400px; - /* 高度由内联样式绑定控制:60vh / 100px */ max-height: 90vh; background-color: var(--background-color); border: 1px solid var(--normal-border-color); diff --git a/frontend_nuxt/utils/markdown.js b/frontend_nuxt/utils/markdown.js index 0d9f8b1c1..268deffd8 100644 --- a/frontend_nuxt/utils/markdown.js +++ b/frontend_nuxt/utils/markdown.js @@ -106,7 +106,7 @@ const md = new MarkdownIt({ md.use(mentionPlugin) md.use(tiebaEmojiPlugin) -md.use(linkPlugin) // 添加链接插件 +md.use(linkPlugin) export function renderMarkdown(text) { return md.render(text || '') diff --git a/frontend_nuxt/utils/vditor.js b/frontend_nuxt/utils/vditor.js index d2211ff15..bd64a3055 100644 --- a/frontend_nuxt/utils/vditor.js +++ b/frontend_nuxt/utils/vditor.js @@ -16,6 +16,7 @@ export function createVditor(editorId, options = {}) { const { placeholder = '', preview = {}, input, after } = options const config = useRuntimeConfig() const API_BASE_URL = config.public.apiBaseUrl + const WEBSITE_BASE_URL = config.public.websiteBaseUrl const fetchMentions = async (value) => { if (!value) { @@ -80,7 +81,7 @@ export function createVditor(editorId, options = {}) { })) }, }, - vditorPostCitation(API_BASE_URL), + vditorPostCitation(API_BASE_URL, WEBSITE_BASE_URL), ], }, cdn: 'https://openisle-1307107697.cos.ap-guangzhou.myqcloud.com/assert/vditor', diff --git a/frontend_nuxt/utils/vditorPostCitation.js b/frontend_nuxt/utils/vditorPostCitation.js index d3fbcad61..0081ab5be 100644 --- a/frontend_nuxt/utils/vditorPostCitation.js +++ b/frontend_nuxt/utils/vditorPostCitation.js @@ -10,7 +10,7 @@ async function searchPost(apiBaseUrl, keyword) { }) } -export default (apiBaseUrl) => { +export default (apiBaseUrl, websiteBaseUrl) => { return { key: '#', hint: async (keyword) => { @@ -22,8 +22,8 @@ export default (apiBaseUrl) => { let value = '' return ( body.map((item) => ({ - value: `[${item.title}](/posts/${item.id})`, - html: `
${item.title}
`, + value: `[🔗${item.title}](${websiteBaseUrl}/posts/${item.id})`, + html: `
${item.title}
`, })) ?? [] ) } else {