From 4002d00672ed5bdc0adedfa3b1329441d07ca8fe Mon Sep 17 00:00:00 2001 From: tsui <1146818706@qq.com> Date: Thu, 24 Jul 2025 15:30:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E5=AD=97=E6=AF=8D=E6=95=B0=E5=AD=97=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81Verify=E5=AD=90=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Verifition/src/Verify.vue | 7 +- .../src/Verify/VerifyPictureWord.vue | 194 ++++++++++++++++++ src/components/Verifition/src/Verify/index.ts | 3 +- src/locales/en.ts | 4 +- src/locales/zh-CN.ts | 4 +- 5 files changed, 206 insertions(+), 6 deletions(-) create mode 100644 src/components/Verifition/src/Verify/VerifyPictureWord.vue diff --git a/src/components/Verifition/src/Verify.vue b/src/components/Verifition/src/Verify.vue index b7b504861..f9dea4ffc 100644 --- a/src/components/Verifition/src/Verify.vue +++ b/src/components/Verifition/src/Verify.vue @@ -36,14 +36,15 @@ * Verify 验证码组件 * @description 分发验证码使用 * */ -import { VerifyPoints, VerifySlide } from './Verify' +import {VerifyPictureWord, VerifyPoints, VerifySlide} from './Verify' import { computed, ref, toRefs, watchEffect } from 'vue' export default { name: 'Vue3Verify', components: { VerifySlide, - VerifyPoints + VerifyPoints, + VerifyPictureWord }, props: { captchaType: { @@ -438,4 +439,4 @@ export default { content: ' '; inset: 0; } - + \ No newline at end of file diff --git a/src/components/Verifition/src/Verify/VerifyPictureWord.vue b/src/components/Verifition/src/Verify/VerifyPictureWord.vue new file mode 100644 index 000000000..4fa26c377 --- /dev/null +++ b/src/components/Verifition/src/Verify/VerifyPictureWord.vue @@ -0,0 +1,194 @@ + + \ No newline at end of file diff --git a/src/components/Verifition/src/Verify/index.ts b/src/components/Verifition/src/Verify/index.ts index 0daa63a56..e027ab3fd 100644 --- a/src/components/Verifition/src/Verify/index.ts +++ b/src/components/Verifition/src/Verify/index.ts @@ -1,4 +1,5 @@ import VerifySlide from './VerifySlide.vue' import VerifyPoints from './VerifyPoints.vue' +import VerifyPictureWord from './VerifyPictureWord.vue' -export { VerifySlide, VerifyPoints } +export { VerifySlide, VerifyPoints, VerifyPictureWord } \ No newline at end of file diff --git a/src/locales/en.ts b/src/locales/en.ts index 505cfd80d..bd4c0b42c 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -146,9 +146,11 @@ export default { invalidTenantName:"Invalid Tenant Name" }, captcha: { + verify: 'Verify', verification: 'Please complete security verification', slide: 'Swipe right to complete verification', point: 'Please click', + code: 'Please enter the verification code', success: 'Verification succeeded', fail: 'verification failed' }, @@ -457,4 +459,4 @@ export default { btn_zoom_out: 'Zoom out', preview: 'Preivew' } -} +} \ No newline at end of file diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 768b5879a..3b6c2e904 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -147,9 +147,11 @@ export default { invalidTenantName: '无效的租户名称' }, captcha: { + verify: '验证', verification: '请完成安全验证', slide: '向右滑动完成验证', point: '请依次点击', + code: '请输入验证码', success: '验证成功', fail: '验证失败' }, @@ -453,4 +455,4 @@ export default { preview: '预览' }, 'OAuth 2.0': 'OAuth 2.0' // 避免菜单名是 OAuth 2.0 时,一直 warn 报错 -} +} \ No newline at end of file -- Gitee From 5a87a41812b10af09ea92797d3a32bc5da361f6c Mon Sep 17 00:00:00 2001 From: tsui <1146818706@qq.com> Date: Sat, 2 Aug 2025 18:59:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E6=98=8E=E7=A1=AE=E6=96=87=E5=AD=97?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E6=8C=89=E9=92=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=EF=BC=8C=E7=99=BB=E5=BD=95=E8=A1=A8=E5=8D=95=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=96=87=E5=AD=97=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=20=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Verifition/src/Verify.vue | 4 ++++ src/components/Verifition/src/Verify/VerifyPictureWord.vue | 4 ++-- src/views/Login/components/LoginForm.vue | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/Verifition/src/Verify.vue b/src/components/Verifition/src/Verify.vue index f9dea4ffc..930d0e721 100644 --- a/src/components/Verifition/src/Verify.vue +++ b/src/components/Verifition/src/Verify.vue @@ -119,6 +119,10 @@ export default { } watchEffect(() => { switch (captchaType.value) { + case 'pictureWord': + verifyType.value = '3' + componentType.value = 'VerifyPictureWord' + break case 'blockPuzzle': verifyType.value = '2' componentType.value = 'VerifySlide' diff --git a/src/components/Verifition/src/Verify/VerifyPictureWord.vue b/src/components/Verifition/src/Verify/VerifyPictureWord.vue index 4fa26c377..f996f648c 100644 --- a/src/components/Verifition/src/Verify/VerifyPictureWord.vue +++ b/src/components/Verifition/src/Verify/VerifyPictureWord.vue @@ -37,7 +37,7 @@ }"> - + @@ -48,7 +48,7 @@ * */ import { resetSize } from '../utils/util'; import { aesEncrypt } from '../utils/ase'; -import { getCode, reqCheck } from 'src/api/login'; +import { getCode, reqCheck } from '@/api/login'; import { getCurrentInstance, nextTick, onMounted, reactive, ref, toRefs } from 'vue'; const props = defineProps({ diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index 3c4e1d1a9..cb4dd429a 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -177,7 +177,8 @@ const permissionStore = usePermissionStore() const redirect = ref('') const loginLoading = ref(false) const verify = ref() -const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字 +const captchaType = ref('pictureWord') // blockPuzzle 滑块 clickWord 点击文字 pictureWord 文字验证码 +// const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字 pictureWord 文字验证码 const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN) @@ -360,4 +361,4 @@ onMounted(() => { cursor: pointer; } } - + \ No newline at end of file -- Gitee