From cf49eb87bc6619f91fe8d6da8c961fa7c5c67b52 Mon Sep 17 00:00:00 2001 From: gzu-liyujiang <1032694760@qq.com> Date: Fri, 8 Aug 2025 05:12:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BE=E5=BD=A2=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E6=94=AF=E6=8C=81=E6=96=87=E5=AD=97=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Verifition/src/Verify.vue | 16 +- .../Verifition/src/Verify/VerifyInput.vue | 162 ++++++++++++++++++ src/components/Verifition/src/Verify/index.ts | 3 +- src/views/Login/SocialLogin.vue | 2 +- .../Login/components/ForgetPasswordForm.vue | 3 +- src/views/Login/components/LoginForm.vue | 4 +- src/views/Login/components/RegisterForm.vue | 4 +- 7 files changed, 183 insertions(+), 11 deletions(-) create mode 100644 src/components/Verifition/src/Verify/VerifyInput.vue diff --git a/src/components/Verifition/src/Verify.vue b/src/components/Verifition/src/Verify.vue index b7b504861..bd7bd21b0 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 { VerifyPoints, VerifySlide, VerifyInput } from './Verify' import { computed, ref, toRefs, watchEffect } from 'vue' export default { name: 'Vue3Verify', components: { VerifySlide, - VerifyPoints + VerifyPoints, + VerifyInput }, props: { captchaType: { @@ -118,14 +119,21 @@ export default { } watchEffect(() => { switch (captchaType.value) { - case 'blockPuzzle': + case 'blockPuzzle': // 滑块拼图 verifyType.value = '2' componentType.value = 'VerifySlide' break - case 'clickWord': + case 'clickWord': // 文字点选 verifyType.value = '' componentType.value = 'VerifyPoints' break + case 'pictureWord': // 文字输入 + verifyType.value = '' + componentType.value = 'VerifyInput' + break + default: + // TODO 不支持的验证码类型,如:rotatePuzzle 旋转拼图 + break } }) diff --git a/src/components/Verifition/src/Verify/VerifyInput.vue b/src/components/Verifition/src/Verify/VerifyInput.vue new file mode 100644 index 000000000..90712d00c --- /dev/null +++ b/src/components/Verifition/src/Verify/VerifyInput.vue @@ -0,0 +1,162 @@ + + + + + + + + + + + + {{ t('login.code') }} + + 确定 + + + + diff --git a/src/components/Verifition/src/Verify/index.ts b/src/components/Verifition/src/Verify/index.ts index 0daa63a56..f00dfe3e4 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 VerifyInput from './VerifyInput.vue' -export { VerifySlide, VerifyPoints } +export {VerifySlide, VerifyPoints, VerifyInput} diff --git a/src/views/Login/SocialLogin.vue b/src/views/Login/SocialLogin.vue index e0caace83..f4a5d19dd 100644 --- a/src/views/Login/SocialLogin.vue +++ b/src/views/Login/SocialLogin.vue @@ -185,7 +185,7 @@ const { push } = useRouter() const permissionStore = usePermissionStore() const loginLoading = ref(false) const verify = ref() -const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字 +const captchaType = ref('blockPuzzle') // blockPuzzle 滑块拼图 clickWord 点击文字 pictureWord 文本输入 const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN) diff --git a/src/views/Login/components/ForgetPasswordForm.vue b/src/views/Login/components/ForgetPasswordForm.vue index 0c3b2e04f..3e6edac71 100644 --- a/src/views/Login/components/ForgetPasswordForm.vue +++ b/src/views/Login/components/ForgetPasswordForm.vue @@ -38,6 +38,7 @@ unref(getLoginState) === LoginStateEnum.RESET_PASSWORD) -const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字 +const captchaType = ref('blockPuzzle') // blockPuzzle 滑块拼图 clickWord 点击文字 pictureWord 文本输入 const validatePass2 = (_rule, value, callback) => { if (value === '') { diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index 3c4e1d1a9..29d0e7ab5 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -82,7 +82,7 @@ ('') const loginLoading = ref(false) const verify = ref() -const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字 +const captchaType = ref('blockPuzzle') // blockPuzzle 滑块拼图 clickWord 点击文字 pictureWord 文本输入 const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN) diff --git a/src/views/Login/components/RegisterForm.vue b/src/views/Login/components/RegisterForm.vue index 0636a1c82..407fe39bb 100644 --- a/src/views/Login/components/RegisterForm.vue +++ b/src/views/Login/components/RegisterForm.vue @@ -85,7 +85,7 @@ ('') const loginLoading = ref(false) const verify = ref() -const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字 +const captchaType = ref('blockPuzzle') // blockPuzzle 滑块拼图 clickWord 点击文字 pictureWord 文本输入 const getShow = computed(() => unref(getLoginState) === LoginStateEnum.REGISTER) -- Gitee