diff --git a/backend/src/main/java/com/openisle/config/SecurityConfig.java b/backend/src/main/java/com/openisle/config/SecurityConfig.java index 5c9572837..51aa0d89e 100644 --- a/backend/src/main/java/com/openisle/config/SecurityConfig.java +++ b/backend/src/main/java/com/openisle/config/SecurityConfig.java @@ -77,8 +77,8 @@ public class SecurityConfig { "http://127.0.0.1", "http://localhost:8080", "http://localhost", - "http://30.211.98.193:8080", - "http://30.211.98.193", + "http://30.211.106.178:8080", + "http://30.211.106.178", "http://192.168.7.70", "http://192.168.7.70:8080", websiteUrl, diff --git a/frontend/package.json b/frontend/package.json index 372208730..b67b5739d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,6 +11,7 @@ "core-js": "^3.8.3", "cropperjs": "^1.6.2", "echarts": "^5.6.0", + "highlight.js": "^10.7.1", "ldrs": "^1.1.7", "markdown-it": "^14.1.0", "vditor": "^3.11.1", diff --git a/frontend/src/assets/global.css b/frontend/src/assets/global.css index 1eaff1765..af5513209 100644 --- a/frontend/src/assets/global.css +++ b/frontend/src/assets/global.css @@ -65,7 +65,22 @@ body { *************************/ .vditor { min-height: 200px; -} +} + +.vditor-toolbar--pin { + top: var(--header-height) !important; +} + +.vditor-panel { + min-width: 400px; +} + +.emoji { + width: 20px; + height: 20px; + vertical-align: middle; +} + /* .vditor { --textarea-background-color: transparent; border: none !important; @@ -220,7 +235,7 @@ body { } .vditor-toolbar { - display: none; + overflow-x: auto; } .about-content h1, @@ -240,6 +255,11 @@ body { margin-bottom: 3px; } + + .vditor-toolbar--pin { + top: 0 !important; + } + .about-content li, .info-content-text li { font-size: 14px; @@ -248,4 +268,9 @@ body { .info-content-text pre { line-height: 1.1; } + + .vditor-panel { + position: relative; + min-width: 0; + } } \ No newline at end of file diff --git a/frontend/src/components/CommentEditor.vue b/frontend/src/components/CommentEditor.vue index 15bab89d6..fe3bc7dd8 100644 --- a/frontend/src/components/CommentEditor.vue +++ b/frontend/src/components/CommentEditor.vue @@ -67,9 +67,11 @@ export default { if (!vditorInstance.value || isDisabled.value) return const value = vditorInstance.value.getValue() console.debug('CommentEditor submit', value) - emit('submit', value) - vditorInstance.value.setValue('') - text.value = '' + emit('submit', value, () => { + if (!vditorInstance.value) return + vditorInstance.value.setValue('') + text.value = '' + }) } onMounted(() => { diff --git a/frontend/src/components/CommentItem.vue b/frontend/src/components/CommentItem.vue index bf8201dda..3eab5be1b 100644 --- a/frontend/src/components/CommentItem.vue +++ b/frontend/src/components/CommentItem.vue @@ -157,7 +157,7 @@ const CommentItem = { toast.error('操作失败') } } - const submitReply = async (text) => { + const submitReply = async (text, clear) => { if (!text.trim()) return isWaitingForReply.value = true const token = getToken() @@ -201,6 +201,7 @@ const CommentItem = { src: data.author.avatar, iconClick: () => router.push(`/users/${data.author.id}`) }) + clear() showEditor.value = false toast.success('回复成功') } else if (res.status === 429) { diff --git a/frontend/src/components/Dropdown.vue b/frontend/src/components/Dropdown.vue index 27f5a641c..062521262 100644 --- a/frontend/src/components/Dropdown.vue +++ b/frontend/src/components/Dropdown.vue @@ -1,13 +1,24 @@