Skip to content

Commit

Permalink
fix: 更新登录时的提示
Browse files Browse the repository at this point in the history
  • Loading branch information
besscroft committed Jan 21, 2024
1 parent d711398 commit 6e9e58f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pages/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@ async function handleSubmitClick(event: FormSubmitEvent<any>) {
router.push('/admin')
if (token) {
toast.add({ title: '登录成功!', timeout: 2000 })
} else {
toast.add({ title: 'token 获取异常,登录失败!', timeout: 2000, color: 'red' })
}
else {
} catch (e) {
if (e?.status === 500) {
toast.add({ title: '用户名或密码错误!', timeout: 2000, color: 'red' })
} else {
toast.add({ title: '登录失败!', timeout: 2000, color: 'red' })
}
}
catch (e) {
toast.add({ title: '登录失败!', timeout: 2000, color: 'red' })
}
finally {
} finally {
loading.value = false
}
}
Expand Down

0 comments on commit 6e9e58f

Please sign in to comment.