From 8ad18f2067ed856128545df0a53f30e64beac284 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 18 Jun 2026 08:09:02 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E4=B8=8D=E5=8F=AF=E5=9C=A8?= =?utf8?q?=E9=A1=B5=E9=9D=A2=E5=A4=8D=E5=88=B6=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- frontend/src/components/StudyMode.css | 13 ++++++++++ frontend/src/components/StudyMode.js | 11 ++++++++- frontend/src/components/TestMode.css | 13 ++++++++++ frontend/src/components/TestMode.js | 35 ++++++++++++++++++++++++--- 4 files changed, 67 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/StudyMode.css b/frontend/src/components/StudyMode.css index af328dd..5e03a46 100644 --- a/frontend/src/components/StudyMode.css +++ b/frontend/src/components/StudyMode.css @@ -7,6 +7,19 @@ padding: 20px; background-color: #f0f7ff; min-height: 100vh; + /* 防止选中单词文本复制作弊 */ + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +/* 输入框需要保持可选可编辑 */ +.study-container input { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; } .study-card { diff --git a/frontend/src/components/StudyMode.js b/frontend/src/components/StudyMode.js index ffc9a14..e612ec5 100644 --- a/frontend/src/components/StudyMode.js +++ b/frontend/src/components/StudyMode.js @@ -99,8 +99,17 @@ function StudyMode() { if (!currentWord) return
加载中...
; + // 阻止复制/剪切/粘贴/右键,防止单词被复制后粘贴作弊 + const blockClipboard = (e) => e.preventDefault(); + return ( -
+
{/* 只有在非闪记模式下显示图片 */} {phase !== 'flashcard' && ( diff --git a/frontend/src/components/TestMode.css b/frontend/src/components/TestMode.css index 1802b83..f1935d5 100644 --- a/frontend/src/components/TestMode.css +++ b/frontend/src/components/TestMode.css @@ -7,6 +7,19 @@ padding: 20px; background-color: #fef9f0; min-height: 100vh; + /* 防止选中单词文本复制作弊 */ + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +/* 输入框需要保持可选可编辑 */ +.test-container input { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; } .test-card { diff --git a/frontend/src/components/TestMode.js b/frontend/src/components/TestMode.js index 74e4741..17de714 100644 --- a/frontend/src/components/TestMode.js +++ b/frontend/src/components/TestMode.js @@ -147,12 +147,21 @@ function TestMode() { return () => window.removeEventListener('keydown', handleKeyDown); }, [handleKeyDown]); + // 阻止复制/剪切/粘贴/右键,防止单词被复制后粘贴作弊 + const blockClipboard = (e) => e.preventDefault(); + // 准备阶段 if (words.length === 0) return
加载中...
; if (phase === 'ready') { return ( -
+

单元测试 - Group {groupId}

共 {words.length} 个单词

@@ -166,7 +175,13 @@ function TestMode() { if (phase === 'complete') { return ( -
+

🎉 测试完成!

Group {groupId} 全部通过!

@@ -178,7 +193,13 @@ function TestMode() { if (phase === 'retest_info') { return ( -
+

📝 开始重考

还有 {wrongQueue.length} 个错题需要重考

@@ -191,7 +212,13 @@ function TestMode() { if (!currentWord) return null; return ( -
+
{/* 状态栏 */}
-- 2.43.0