Skip to content

Commit 35a2bee

Browse files
committed
add unkown error
1 parent 89f462d commit 35a2bee

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/components/user/changePassword.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ export default {
6060
callback();
6161
})
6262
.catch(err => {
63-
callback(new Error('Old Password Wrong'));
63+
if(err.request.status === 403) {
64+
callback(new Error('Old Password Wrong'));
65+
} else {
66+
callback(new Error('Unkown Error'));
67+
}
6468
});
6569
};
6670
return {

src/components/user/register.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ export default {
8585
}
8686
};
8787
let validateUsername = (rule, value, callback) => {
88+
if(value === '') {
89+
callback();
90+
}
8891
this.$axios
8992
.get(apiurl('account/username/accessibility/' + value))
9093
.then(() => {
@@ -94,7 +97,7 @@ export default {
9497
if (err.request.status === 409) {
9598
callback(new Error('The user name is already in use'));
9699
} else {
97-
callback();
100+
callback(new Error('Unkown Error'));
98101
}
99102
});
100103
};

0 commit comments

Comments
 (0)