어렵다 어려워 ...

This commit is contained in:
이진석
2020-02-06 12:48:01 +09:00
parent 85f24d9d0f
commit dcd27758f7
3 changed files with 6 additions and 9 deletions

View File

@@ -40,9 +40,8 @@
articleService.removeArticle = articleService.removeArticle.bind(this);
},
async created() {
await articleService.getArticle(this.$route.params.id);
this.article = await articleService.getArticle(this.$route.params.id);
this.init = true;
},
methods: {
async remove() {

View File

@@ -46,7 +46,8 @@
},
async created() {
await authService.banishIfUserUnAuthenticated();
await articleService.getArticles({});
this.articles = await articleService.getArticles({});
this.pending = false;
},
methods: {
async logout() {

View File

@@ -5,8 +5,7 @@ export default {
async getArticles({page = 0, size = 10}) {
try {
const result = await articleApi.getArticles({page, size}, commonUtil.getAuthenticationHeaderBearer(this.$cookie.get('accessToken')));
this.articles = result.data;
this.pending = false;
return result.data;
} catch (err) {
alert('문제가 발생하였습니다.');
console.log(err.response);
@@ -16,9 +15,7 @@ export default {
try {
const authorization = commonUtil.getAuthenticationHeaderBearer(this.$cookie.get('accessToken'));
const result = await articleApi.getArticle({articleId}, authorization);
this.article = result.data;
this.init = true;
return result.data;
} catch (e) {
alert('문제가 발생하였습니다.');
console.log(e);