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')); const authorization = commonUtil.getAuthenticationHeaderBearer(this.$cookie.get('accessToken'));
await articleApi.removeArticle({articleId}, authorization); await articleApi.removeArticle({articleId}, authorization);
await this.$router.push('/articles'); await this.$router.push('/articles');
} catch (e) { } catch (err) {
alert('문제가 발생하였습니다.'); alert('문제가 발생하였습니다.');
console.log(e); console.log(err);
} }
}, },
async postArticle(data) { async postArticle(data) {

View File

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