어렵다 어려워 ...
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -46,7 +46,8 @@
|
||||
},
|
||||
async created() {
|
||||
await authService.banishIfUserUnAuthenticated();
|
||||
await articleService.getArticles({});
|
||||
this.articles = await articleService.getArticles({});
|
||||
this.pending = false;
|
||||
},
|
||||
methods: {
|
||||
async logout() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user