...
|
...
|
@@ -3,12 +3,23 @@ import { get } from 'lodash'; |
|
|
import * as guangProcess from './guangProcess';
|
|
|
|
|
|
export default {
|
|
|
async fetchArticleList({ commit }, { articleId, limit = 5, page = 1 }) {
|
|
|
commit(Types.FETCH_ARTICLE_DETAIL_REQUEST);
|
|
|
const result = await this.$api.get('/api/grass/columnArticleDetail', {
|
|
|
async fetchArticleList({ commit }, { articleId, authorUid, authorType, type, limit = 5, page = 1 }) {
|
|
|
commit(Types.FETCH_ARTICLE_LIST_REQUEST);
|
|
|
let api;
|
|
|
|
|
|
if (type === 'fav') {
|
|
|
api = '/api/grass/userFavouriteArticleDetail';
|
|
|
} else if (type === 'publish') {
|
|
|
api = '/api/grass/userPublishedArticleDetail';
|
|
|
} else {
|
|
|
api = '/api/grass/columnArticleDetail';
|
|
|
}
|
|
|
const result = await this.$api.get(api, {
|
|
|
articleId,
|
|
|
limit,
|
|
|
page,
|
|
|
authorUid,
|
|
|
authorType,
|
|
|
columnType: 1001
|
|
|
});
|
|
|
|
...
|
...
|
@@ -16,12 +27,12 @@ export default { |
|
|
if (!result.data.detailList) {
|
|
|
result.data.detailList = [];
|
|
|
}
|
|
|
commit(Types.FETCH_ARTICLE_DETAIL_SUCCESS, {
|
|
|
commit(Types.FETCH_ARTICLE_LIST_SUCCESS, {
|
|
|
data: result.data.detailList,
|
|
|
page
|
|
|
});
|
|
|
} else {
|
|
|
commit(Types.FETCH_ARTICLE_DETAIL_FAILD);
|
|
|
commit(Types.FETCH_ARTICLE_LIST_FAILD);
|
|
|
}
|
|
|
return result;
|
|
|
},
|
...
|
...
|
|