update
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -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('/');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user