Commit fe25afafbe1dd74413e79d539e2fb04afe8dcefa

Authored by xingyu
1 parent b78378ce

feat: AJ-Captcha add check

yudao-ui-admin-vue3/src/api/login/types.ts
1 1 export type UserLoginVO = {
2 2 username: string
3 3 password: string
  4 + captchaVerification: string
4 5 }
5 6  
6 7 export type TokenType = {
... ...
yudao-ui-admin-vue3/src/views/Login/components/LoginForm.vue
... ... @@ -70,6 +70,7 @@ const loginData = reactive({
70 70 tenantName: '芋道源码',
71 71 username: 'admin',
72 72 password: 'admin123',
  73 + captchaVerification: '',
73 74 rememberMe: false
74 75 }
75 76 })
... ... @@ -101,11 +102,15 @@ const getCookie = () => {
101 102 }
102 103 }
103 104 // 登录
104   -const handleLogin = async () => {
  105 +const handleLogin = async (params) => {
  106 + loginLoading.value = true
105 107 await getTenantId()
106 108 const data = await validForm()
107   - if (!data) return
108   - loginLoading.value = true
  109 + if (!data) {
  110 + loginLoading.value = false
  111 + return
  112 + }
  113 + loginData.loginForm.captchaVerification = params.captchaVerification
109 114 const res = await LoginApi.loginApi(loginData.loginForm)
110 115 setToken(res)
111 116 const userInfo = await LoginApi.getInfoApi()
... ...