This commit is contained in:
leejinseok
2020-02-14 12:05:03 +09:00
parent 189a541e95
commit 6572f5b689
2 changed files with 7 additions and 6 deletions

View File

@@ -35,9 +35,9 @@ export default {
const authorization = commonUtil.getAuthenticationHeaderBearer(this.$cookie.get('accessToken'));
await articleApi.removeArticle({articleId}, authorization);
await this.$router.push('/articles');
} catch (e) {
} catch (err) {
alert('문제가 발생하였습니다.');
console.log(e);
console.log(err);
}
},
async postArticle(data) {

View File

@@ -33,9 +33,9 @@ export default {
async logout() {
try {
this.$cookie.set('accessToken', null, 0);
await this.$router.push('/');
} catch (e) {
console.log(e);
location.reload();
} catch (err) {
console.log(err);
}
},
async progressIfUserAuthenticated() {
@@ -49,8 +49,9 @@ export default {
async banishIfUserUnAuthenticated() {
try {
await authApi.session(commonUtil.getAuthenticationHeaderBearer(this.$cookie.get('accessToken')));
} catch (e) {
} catch (err) {
alert('토큰이 존재하지 않거나 유효하지 않은 토큰입니다.');
console.log(err);
await this.$router.replace('/');
}
},