Skip to content

Commit

Permalink
fix: login fetch error
Browse files Browse the repository at this point in the history
  • Loading branch information
chansee97 committed Jun 5, 2024
1 parent 4aa3a66 commit e201ff0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/store/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ export const useAuthStore = defineStore('auth-store', {

/* 用户登录 */
async login(userName: string, password: string) {
const { isSuccess, data } = await fetchLogin({ userName, password })
if (!isSuccess)
return
try {
const { isSuccess, data } = await fetchLogin({ userName, password })
if (!isSuccess)
return

// 处理登录信息
await this.handleAfterLogin(data)
// 处理登录信息
await this.handleAfterLogin(data)
}
catch (e) {
}
},

/* 登录后的处理函数 */
Expand Down

0 comments on commit e201ff0

Please sign in to comment.