From 85523e8321ffe3f5f0ea76e9cd9adda4e12418ea Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Tue, 11 Mar 2025 19:34:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(auth):=20=E6=B7=BB=E5=8A=A0=E6=BB=91?= =?UTF-8?q?=E5=8A=A8=E9=AA=8C=E8=AF=81=E7=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 auth API 中新增 userCaptcha 和 userCaptchaValidate 方法 - 在登录页面集成滑动验证码组件 - 实现验证码获取 --- app/api/auth/index.js | 14 ++ app/components/YourPuzzleComponent.vue | 307 +++++++++++++++++++++++++ app/pages/login/index.vue | 95 +++++++- app/static/images/reset.png | Bin 0 -> 1127 bytes package.json | 3 +- pnpm-lock.yaml | 22 +- 6 files changed, 421 insertions(+), 20 deletions(-) create mode 100644 app/components/YourPuzzleComponent.vue create mode 100644 app/static/images/reset.png diff --git a/app/api/auth/index.js b/app/api/auth/index.js index 66c5ee3..b1056b6 100644 --- a/app/api/auth/index.js +++ b/app/api/auth/index.js @@ -22,4 +22,18 @@ export async function userUpdate(data) { method: 'POST', data }) +} +export async function userCaptcha(data) { + return await request( { + url:'/api/v1/m/user/captcha', + method: 'POST', + data + }) +} +export async function userCaptchaValidate(data) { + return await request( { + url:'/mall/user/validate/captcha', + method: 'POST', + data + }) } \ No newline at end of file diff --git a/app/components/YourPuzzleComponent.vue b/app/components/YourPuzzleComponent.vue new file mode 100644 index 0000000..66f0562 --- /dev/null +++ b/app/components/YourPuzzleComponent.vue @@ -0,0 +1,307 @@ + + + + + diff --git a/app/pages/login/index.vue b/app/pages/login/index.vue index 29526bb..70176c7 100644 --- a/app/pages/login/index.vue +++ b/app/pages/login/index.vue @@ -1,15 +1,21 @@ @@ -238,4 +298,15 @@ onUnmounted(() => { width: 41px; height: 41px; } + +.verify-popup-content { + width: 90vw; + max-width: 350px; + padding: 20px; + box-sizing: border-box; +} + +:deep(.van-popup) { + background: transparent; +} diff --git a/app/static/images/reset.png b/app/static/images/reset.png new file mode 100644 index 0000000000000000000000000000000000000000..f10bfe575152c97c7b2d3231486130aa17dd7f2e GIT binary patch literal 1127 zcmV-t1ep7YP)JR(-b}|lqU#22VhwO$N;xR+zs7M;4(^aMKsu~!2Q<1i6Q{8 zSCo1?Qe1y7)xwGDE{Og7DuLQTcjH>8aA^U(7rwf;fLfGbp{YUz=L{D&9V>1a%4Sg~ zK69qHD%RTx!FCJWC0QExMjmV#bFxsjwzhyzpYL6sr(_gh{`KH8VQ8AyE~VK*%;jeb zSal)j2iap*Pu@LR(qvNfWM4)z=_gwh)3ih!+OkjW<-bQ}F7Mcb0`c+pjoEaYd}JUWsu4pmu|!U=kV|23Iv4 zb_!#)uO0qywNMX%=m?dz+4jejXRtCBd>+CtX&Qwx4rpr!-Sv_A!quD(c&ST2!I>s5 zkS!rk+b5~w+80T*_hkSdUvs*mYkW2reXsV1Km`mr46tApXy)ca**H+zw$BPVXCJJH z_O&a>PD4|^T(p*&k?uML?gO|u#qrTWG!J4jJJRzafX`vM zH(J_QTqt!%Jne^O|Ig^MFkiT2|LU_nE7T-oB(4ttL4@S4gk4<8MEG(4w+ja78xC}l z*k)Fa{!m%#2abv)m#WRisy!2U3~~8B`3#C+!Z5U=aQW7h1K^gWxccNr_bC-WLvn>_ z^McNSGXD-cL2e0PqVK7=d;#)NGo1WM!&TB>zSXt}vj+4H2M!T3pnJyN3v+iol>&)r z0q8q~e97GO|FagLCFJqXIWn^X^quNyr||u2P?rVLPvLh4a2{YDC~g9E1d=Wr<}HYz zBUI*pJ>6M%4Cou~E(X+(rZ$mo70Yu0cZWQ!Z)D<@1z=B*WMd}5tu_Mr8{p=2X>~M7 ztcyJPQ`bEO&E}F5sH8pB65ink*qyfv)tc6NOW!PZYhD)%Tcrr8wP= tbNxJL3g#MY!7d9HGiy002ovPDHLkV1iN62r>Ww literal 0 HcmV?d00001 diff --git a/package.json b/package.json index b0a46f5..16eeaef 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ "vue-demi": "^0.14.10", "vue-pdf-embed": "^2.1.2", "vue-router": "^4.5.0", - "vue-signature-pad": "^3.0.2" + "vue-signature-pad": "^3.0.2", + "vue3-puzzle-vcode": "1.1.6-nuxt" }, "devDependencies": { "@iconify-json/carbon": "^1.2.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ea90507..dcd80b1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -77,6 +77,9 @@ importers: vue-signature-pad: specifier: ^3.0.2 version: 3.0.2(vue@3.5.13(typescript@5.7.3)) + vue3-puzzle-vcode: + specifier: 1.1.6-nuxt + version: 1.1.6-nuxt devDependencies: '@iconify-json/carbon': specifier: ^1.2.5 @@ -809,8 +812,8 @@ packages: resolution: {integrity: sha512-8tR1xe7ZEbkabTuE/tNhzpolygUn9OaYp9yuYAF4MgDNZg06C3Qny80bes2/e9/Wm3aVkPUlCw6WgU7mQd0yEg==} engines: {node: '>= 16'} - '@intlify/shared@11.1.1': - resolution: {integrity: sha512-2kGiWoXaeV8HZlhU/Nml12oTbhv7j2ufsJ5vQaa0VTjzUmZVdd/nmKFRAOJ/FtjO90Qba5AnZDwsrY7ZND5udA==} + '@intlify/shared@11.1.2': + resolution: {integrity: sha512-dF2iMMy8P9uKVHV/20LA1ulFLL+MKSbfMiixSmn6fpwqzvix38OIc7ebgnFbBqElvghZCW9ACtzKTGKsTGTWGA==} engines: {node: '>= 16'} '@intlify/unplugin-vue-i18n@6.0.3': @@ -4618,6 +4621,9 @@ packages: peerDependencies: vue: ^3.2.0 + vue3-puzzle-vcode@1.1.6-nuxt: + resolution: {integrity: sha512-V3DrPIYznxko8jBAtZtmsNPw9QmkPnFicQ0p9B192vC3ncRv4IDazhLC7D/cY/OGq0OeqXmk2DiOcBR7dyt8GQ==} + vue@3.5.13: resolution: {integrity: sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==} peerDependencies: @@ -5342,14 +5348,14 @@ snapshots: '@intlify/shared@11.0.0-rc.1': {} - '@intlify/shared@11.1.1': {} + '@intlify/shared@11.1.2': {} '@intlify/unplugin-vue-i18n@6.0.3(@vue/compiler-dom@3.5.13)(eslint@9.20.1(jiti@2.4.2))(rollup@4.34.6)(typescript@5.7.3)(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3))': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.20.1(jiti@2.4.2)) '@intlify/bundle-utils': 10.0.0(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3))) - '@intlify/shared': 11.1.1 - '@intlify/vue-i18n-extensions': 8.0.0(@intlify/shared@11.1.1)(@vue/compiler-dom@3.5.13)(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3)) + '@intlify/shared': 11.1.2 + '@intlify/vue-i18n-extensions': 8.0.0(@intlify/shared@11.1.2)(@vue/compiler-dom@3.5.13)(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3)) '@rollup/pluginutils': 5.1.4(rollup@4.34.6) '@typescript-eslint/scope-manager': 8.24.0 '@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3) @@ -5373,11 +5379,11 @@ snapshots: '@intlify/utils@0.13.0': {} - '@intlify/vue-i18n-extensions@8.0.0(@intlify/shared@11.1.1)(@vue/compiler-dom@3.5.13)(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3))': + '@intlify/vue-i18n-extensions@8.0.0(@intlify/shared@11.1.2)(@vue/compiler-dom@3.5.13)(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3))': dependencies: '@babel/parser': 7.26.8 optionalDependencies: - '@intlify/shared': 11.1.1 + '@intlify/shared': 11.1.2 '@vue/compiler-dom': 3.5.13 vue: 3.5.13(typescript@5.7.3) vue-i18n: 10.0.5(vue@3.5.13(typescript@5.7.3)) @@ -9896,6 +9902,8 @@ snapshots: signature_pad: 3.0.0-beta.4 vue: 3.5.13(typescript@5.7.3) + vue3-puzzle-vcode@1.1.6-nuxt: {} + vue@3.5.13(typescript@5.7.3): dependencies: '@vue/compiler-dom': 3.5.13