From e37ed1b70b04adf19f8fdb1f1bde2404b222a685 Mon Sep 17 00:00:00 2001
From: wangshun <932054296@qq.com>
Date: Wed, 10 Sep 2025 15:40:49 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E8=AF=84=E8=AE=BA=E8=BF=BD=E5=8A=A0?=
=?UTF-8?q?=E5=BF=AB=E6=8D=B7=E9=94=AE=20ps:schedule=E5=8C=85=E5=90=8D?=
=?UTF-8?q?=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../UserVisitScheduler.java | 2 +-
frontend_nuxt/components/CommentEditor.vue | 56 ++++++++++++++++---
2 files changed, 48 insertions(+), 10 deletions(-)
rename backend/src/main/java/com/openisle/{schdule => scheduler}/UserVisitScheduler.java (98%)
diff --git a/backend/src/main/java/com/openisle/schdule/UserVisitScheduler.java b/backend/src/main/java/com/openisle/scheduler/UserVisitScheduler.java
similarity index 98%
rename from backend/src/main/java/com/openisle/schdule/UserVisitScheduler.java
rename to backend/src/main/java/com/openisle/scheduler/UserVisitScheduler.java
index c3fb58c50..ff16fe3c4 100644
--- a/backend/src/main/java/com/openisle/schdule/UserVisitScheduler.java
+++ b/backend/src/main/java/com/openisle/scheduler/UserVisitScheduler.java
@@ -1,4 +1,4 @@
-package com.openisle.schdule;
+package com.openisle.scheduler;
import com.openisle.config.CachingConfig;
import com.openisle.model.User;
diff --git a/frontend_nuxt/components/CommentEditor.vue b/frontend_nuxt/components/CommentEditor.vue
index 68203de89..7e94e8051 100644
--- a/frontend_nuxt/components/CommentEditor.vue
+++ b/frontend_nuxt/components/CommentEditor.vue
@@ -6,8 +6,15 @@
@@ -58,6 +65,15 @@ export default {
if (!editorId.value) {
editorId.value = 'editor-' + useId()
}
+
+ const isMac = ref(false)
+
+ if (navigator.userAgentData) {
+ isMac.value = navigator.userAgentData.platform === 'macOS'
+ } else {
+ isMac.value = /Mac|iPhone|iPad|iPod/.test(navigator.userAgent)
+ }
+
const getEditorTheme = getEditorThemeUtil
const getPreviewTheme = getPreviewThemeUtil
const applyTheme = () => {
@@ -96,7 +112,23 @@ export default {
applyTheme()
},
})
- // applyTheme()
+
+ // 添加快捷键监听 (Ctrl+Enter 或 Cmd+Enter)
+ const handleKeydown = (e) => {
+ if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
+ e.preventDefault()
+ submit()
+ }
+ }
+ const el = document.getElementById(editorId.value)
+ if (el) {
+ el.addEventListener('keydown', handleKeydown)
+ }
+ onUnmounted(() => {
+ if (el) {
+ el.removeEventListener('keydown', handleKeydown)
+ }
+ })
})
onUnmounted(() => {
@@ -134,7 +166,7 @@ export default {
},
)
- return { submit, isDisabled, editorId }
+ return { submit, isDisabled, editorId, isMac }
},
}
@@ -174,10 +206,16 @@ export default {
.comment-submit:hover {
background-color: var(--primary-color-hover);
}
-
-@media (max-width: 768px) {
- .comment-editor-container {
- margin-bottom: 10px;
- }
+/** 评论按钮快捷键样式 */
+.shortcut-icon {
+ padding: 2px 6px;
+ border-radius: 6px;
+ font-size: 12px;
+ font-weight: 500;
+ line-height: 1.2;
+ background-color: rgba(0, 0, 0, 0.25);
+}
+.comment-submit.disabled .shortcut-icon {
+ background-color: rgba(0, 0, 0, 0);
}
From b20b705e4697c166da1d10dba39fc8bbea03c854 Mon Sep 17 00:00:00 2001
From: wangshun <932054296@qq.com>
Date: Wed, 10 Sep 2025 17:44:53 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BF=AB=E6=8D=B7?=
=?UTF-8?q?=E9=94=AE=20+=20=E4=B8=8D=E6=98=AF=E6=89=8B=E6=9C=BA=E7=9A=84?=
=?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E4=B8=8D=E5=90=AF=E7=94=A8=E5=BF=AB?=
=?UTF-8?q?=E6=8D=B7=E9=94=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend_nuxt/components/CommentEditor.vue | 33 +++++++++++++---------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/frontend_nuxt/components/CommentEditor.vue b/frontend_nuxt/components/CommentEditor.vue
index 7e94e8051..b613a72d5 100644
--- a/frontend_nuxt/components/CommentEditor.vue
+++ b/frontend_nuxt/components/CommentEditor.vue
@@ -59,6 +59,7 @@ export default {
},
components: { LoginOverlay },
setup(props, { emit }) {
+ const isMobile = useIsMobile()
const vditorInstance = ref(null)
const text = ref('')
const editorId = ref(props.editorId)
@@ -112,23 +113,27 @@ export default {
applyTheme()
},
})
+ // 不是手机的情况下不添加快捷键
+ if(!isMobile.value){
+ // 添加快捷键监听 (Ctrl+Enter 或 Cmd+Enter)
+ const handleKeydown = (e) => {
+ if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
+ e.preventDefault()
+ submit()
+ }
+ }
- // 添加快捷键监听 (Ctrl+Enter 或 Cmd+Enter)
- const handleKeydown = (e) => {
- if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
- e.preventDefault()
- submit()
- }
- }
- const el = document.getElementById(editorId.value)
- if (el) {
- el.addEventListener('keydown', handleKeydown)
- }
- onUnmounted(() => {
+ const el = document.getElementById(editorId.value)
if (el) {
- el.removeEventListener('keydown', handleKeydown)
+ el.addEventListener('keydown', handleKeydown)
}
- })
+
+ onUnmounted(() => {
+ if (el) {
+ el.removeEventListener('keydown', handleKeydown)
+ }
+ })
+ }
})
onUnmounted(() => {
From 0e46a67ea6e4dcbd52662af33442ebc1e3d0e3b5 Mon Sep 17 00:00:00 2001
From: wangshun <932054296@qq.com>
Date: Wed, 10 Sep 2025 18:01:07 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E8=AF=84=E8=AE=BA=E8=BF=BD=E5=8A=A0?=
=?UTF-8?q?=E5=BF=AB=E6=8D=B7=E9=94=AE=201.=E6=89=8B=E6=9C=BA=E6=97=B6?=
=?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BAicon=EF=BC=8C=E4=B8=94=E5=BF=AB?=
=?UTF-8?q?=E6=8D=B7=E9=94=AE=E4=B8=8D=E8=B5=B7=E7=94=A8=202.=E7=94=B5?=
=?UTF-8?q?=E8=84=91=E7=AB=AF=E9=80=82=E9=85=8Dwin=E5=92=8Cmac?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend_nuxt/components/CommentEditor.vue | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/frontend_nuxt/components/CommentEditor.vue b/frontend_nuxt/components/CommentEditor.vue
index b613a72d5..3a8408f85 100644
--- a/frontend_nuxt/components/CommentEditor.vue
+++ b/frontend_nuxt/components/CommentEditor.vue
@@ -8,7 +8,7 @@