From b0260112e5ff9fb9f29982b1ae2c9e8959bf49b3 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Tue, 26 Aug 2025 17:25:53 +0800 Subject: [PATCH] =?UTF-8?q?v1.9=20=E7=99=BB=E9=99=86=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user/loginApi.js | 2 +- src/views/user/login/Login.vue | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api/user/loginApi.js b/src/api/user/loginApi.js index 4987a094c..a29b20000 100644 --- a/src/api/user/loginApi.js +++ b/src/api/user/loginApi.js @@ -13,7 +13,7 @@ export function login(data) { // 可以在这里添加其他登录成功后的处理 resolve(res) } else { - reject(new Error(res.msg || '登录失败')) + reject(res.msg || '登录失败') } }).catch(error => { reject(error) diff --git a/src/views/user/login/Login.vue b/src/views/user/login/Login.vue index 7020dc5e7..c71049145 100644 --- a/src/views/user/login/Login.vue +++ b/src/views/user/login/Login.vue @@ -86,10 +86,13 @@ export default { this.loading = true; try { const { data } = await login(this.loginForm).catch(error => { - this.$message.error(error.response.data); + this.$message.error(error); this.refreshCaptcha(); return { data: [] }; }); + if (!data || data.length == 0) { + return; + } if (data && data.length > 1) { this.$refs.selectLoginUserRef.openDialog(data);