Skip to content

Commit 8d81c98

Browse files
committed
perf[getInfo]: stop run after reject
1 parent 7c06214 commit 8d81c98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/store/modules/user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ const actions = {
5151
const { data } = response
5252

5353
if (!data) {
54-
reject('Verification failed, please Login again.')
54+
return reject('Verification failed, please Login again.')
5555
}
5656

5757
const { roles, name, avatar, introduction } = data
5858

5959
// roles must be a non-empty array
6060
if (!roles || roles.length <= 0) {
61-
reject('getInfo: roles must be a non-null array!')
61+
return reject('getInfo: roles must be a non-null array!')
6262
}
6363

6464
commit('SET_ROLES', roles)

0 commit comments

Comments
 (0)