feat: fix 注册失败和登录失败

This commit is contained in:
tim
2025-08-10 11:50:21 +08:00
parent 1a8e216aa9
commit 1177a778ee
3 changed files with 15 additions and 20 deletions
+2 -1
View File
@@ -82,7 +82,6 @@ export default {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username: this.username, password: this.password })
})
this.isWaitingForLogin = false
const data = await res.json()
if (res.ok && data.token) {
setToken(data.token)
@@ -103,6 +102,8 @@ export default {
}
} catch (e) {
toast.error('登录失败')
} finally {
this.isWaitingForLogin = false
}
},