From 2ef5f5967db688dcaad6042efda8a49564bde296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Sun, 13 Mar 2022 15:59:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor(login/index.vue):=20=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4v-on=E5=BA=9F=E5=BC=83=E7=9A=84native=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=EF=BC=8CTypeScript=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/index.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 8fe425e6..5b6619eb 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -190,8 +190,7 @@ function handleLogin() { loginFormRef.value.validate((valid: boolean) => { if (valid) { state.loading = true; - user - .login(state.loginForm) + user.login(state.loginForm) .then(() => { router.push({ path: state.redirect || "/", query: state.otherQuery }); state.loading = false; @@ -208,8 +207,8 @@ function handleLogin() { // 获取验证码 function handleCaptchaGenerate() { - getCaptcha().then((response) => { - const { img, uuid } = response.data; + getCaptcha().then(({data}) => { + const { img, uuid } = data; state.captchaBase64 = "data:image/gif;base64," + img; state.loginForm.uuid = uuid; });