feat: replace alerts with toast notifications

This commit is contained in:
Tim
2025-07-04 22:20:01 +08:00
parent b17df96060
commit 245190d477
5 changed files with 28 additions and 12 deletions
+3 -3
View File
@@ -68,13 +68,13 @@ export default {
const data = await res.json()
if (res.ok && data.token) {
localStorage.setItem('token', data.token)
alert('登录成功')
this.$toast.success('登录成功')
this.$router.push('/')
} else {
alert(data.error || '登录失败')
this.$toast.error(data.error || '登录失败')
}
} catch (e) {
alert('登录失败')
this.$toast.error('登录失败')
}
}
}