From 5c865d3a3af46c1d494f84641148ae7dbaeda5d8 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 3 Aug 2022 09:54:18 +0800 Subject: [PATCH] feat: AJ-Captcha add check --- yudao-ui-admin-vue3/src/api/login/types.ts | 1 + .../src/views/Login/components/LoginForm.vue | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/yudao-ui-admin-vue3/src/api/login/types.ts b/yudao-ui-admin-vue3/src/api/login/types.ts index 29bc80642..1a91aecc1 100644 --- a/yudao-ui-admin-vue3/src/api/login/types.ts +++ b/yudao-ui-admin-vue3/src/api/login/types.ts @@ -1,6 +1,7 @@ export type UserLoginVO = { username: string password: string + captchaVerification: string } export type TokenType = { diff --git a/yudao-ui-admin-vue3/src/views/Login/components/LoginForm.vue b/yudao-ui-admin-vue3/src/views/Login/components/LoginForm.vue index 0a43fa675..6fd0f994e 100644 --- a/yudao-ui-admin-vue3/src/views/Login/components/LoginForm.vue +++ b/yudao-ui-admin-vue3/src/views/Login/components/LoginForm.vue @@ -70,6 +70,7 @@ const loginData = reactive({ tenantName: '芋道源码', username: 'admin', password: 'admin123', + captchaVerification: '', rememberMe: false } }) @@ -101,11 +102,15 @@ const getCookie = () => { } } // 登录 -const handleLogin = async () => { +const handleLogin = async (params) => { + loginLoading.value = true await getTenantId() const data = await validForm() - if (!data) return - loginLoading.value = true + if (!data) { + loginLoading.value = false + return + } + loginData.loginForm.captchaVerification = params.captchaVerification const res = await LoginApi.loginApi(loginData.loginForm) setToken(res) const userInfo = await LoginApi.getInfoApi()