...
|
...
|
@@ -53,8 +53,6 @@ const _processListData = (list) => { |
|
|
return listData;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 首页、列表页列表相关
|
|
|
* @param type
|
...
|
...
|
@@ -121,7 +119,7 @@ const getListData = (appType, pageNum, limit, udid, gender, tag, authorId) => { |
|
|
*/
|
|
|
const _getAuthorData = (id) => {
|
|
|
|
|
|
return serviceAPI.get('/guang/service/*/author/getAuthor', {
|
|
|
return serviceAPI.get('guang/service/*/author/getAuthor', {
|
|
|
author_id: id
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
...
|
...
|
@@ -182,7 +180,6 @@ const _processHeadData = (list) => { |
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
if (index === 2) {
|
|
|
newData.headData = _.assign(newData.headData, {
|
|
|
commentNum: data.total
|
...
|
...
|
@@ -358,7 +355,7 @@ const _getHeadData = (id, appType, uid, udid) => { |
|
|
par.udid = udid;
|
|
|
}
|
|
|
|
|
|
return serviceAPI.get('/guang/api/*/article/getArticleBaseInfo', par).then((result) => {
|
|
|
return serviceAPI.get('guang/api/*/article/getArticleBaseInfo', par).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
return result.data;
|
|
|
} else {
|
...
|
...
|
@@ -374,7 +371,7 @@ const _getHeadData = (id, appType, uid, udid) => { |
|
|
* @returns {*}
|
|
|
*/
|
|
|
const _getContentData = (id) => {
|
|
|
return serviceAPI.get('/guang/service/*/article/getArticleContent', {
|
|
|
return serviceAPI.get('guang/service/*/article/getArticleContent', {
|
|
|
article_id: id
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
...
|
...
|
@@ -392,7 +389,7 @@ const _getContentData = (id) => { |
|
|
* @returns {*}
|
|
|
*/
|
|
|
const _getArticleData = (id) => {
|
|
|
return serviceAPI.get('/guang/service/v2/article/getArticle', {
|
|
|
return serviceAPI.get('guang/service/v2/article/getArticle', {
|
|
|
article_id: id
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
...
|
...
|
@@ -410,7 +407,7 @@ const _getArticleData = (id) => { |
|
|
* @returns {*}
|
|
|
*/
|
|
|
const _getCommentsData = (id) => {
|
|
|
return serviceAPI.get('/guang/api/*/comments/getList', {
|
|
|
return serviceAPI.get('guang/api/*/comments/getList', {
|
|
|
article_id: id
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
...
|
...
|
@@ -457,7 +454,7 @@ const _getRelateBrand = (id) => { |
|
|
* @returns {*}
|
|
|
*/
|
|
|
const _getArticlePre = (id, appType) => {
|
|
|
return serviceAPI.get('/guang/api/*/article/getArticlePre', {
|
|
|
return serviceAPI.get('guang/api/*/article/getArticlePre', {
|
|
|
id: id,
|
|
|
app_type: appType
|
|
|
}).then((result) => {
|
...
|
...
|
@@ -491,7 +488,7 @@ const _getArticlePre = (id, appType) => { |
|
|
* @returns {*}
|
|
|
*/
|
|
|
const _getArticleNext = (id, appType) => {
|
|
|
return serviceAPI.get('/guang/api/*/article/getArticleNext', {
|
|
|
return serviceAPI.get('guang/api/*/article/getArticleNext', {
|
|
|
id: id,
|
|
|
app_type: appType
|
|
|
}).then((result) => {
|
...
|
...
|
@@ -534,7 +531,7 @@ const setCollect = (id, uid, appType) => { |
|
|
message: '未登录'
|
|
|
});
|
|
|
}
|
|
|
return serviceAPI.get('/guang/api/*/favorite/setFavorite', {
|
|
|
return serviceAPI.get('guang/api/*/favorite/setFavorite', {
|
|
|
article_id: id,
|
|
|
uid: uid,
|
|
|
app_type: appType
|
...
|
...
|
@@ -554,7 +551,7 @@ const cancelCollect = (id, uid, appType) => { |
|
|
message: '未登录'
|
|
|
});
|
|
|
}
|
|
|
return serviceAPI.get('/guang/api/*/favorite/cancelFavorite', {
|
|
|
return serviceAPI.get('guang/api/*/favorite/cancelFavorite', {
|
|
|
article_id: id,
|
|
|
uid: uid,
|
|
|
app_type: appType
|
...
|
...
|
@@ -569,7 +566,7 @@ const cancelCollect = (id, uid, appType) => { |
|
|
*/
|
|
|
const setPraise = (id, udid, appType) => {
|
|
|
|
|
|
return serviceAPI.get('/guang/api/v2/praise/setPraise', {
|
|
|
return serviceAPI.get('guang/api/v2/praise/setPraise', {
|
|
|
article_id: id,
|
|
|
udid: udid,
|
|
|
app_type: appType
|
...
|
...
|
@@ -584,7 +581,7 @@ const setPraise = (id, udid, appType) => { |
|
|
*/
|
|
|
const cancelPraise = (id, udid, appType) => {
|
|
|
|
|
|
return serviceAPI.get('/guang/api/v2/praise/cancel', {
|
|
|
return serviceAPI.get('guang/api/v2/praise/cancel', {
|
|
|
article_id: id,
|
|
|
udid: udid,
|
|
|
app_type: appType
|
...
|
...
|
@@ -605,7 +602,7 @@ const addComment = (id, uid, comment) => { |
|
|
message: '未登录'
|
|
|
});
|
|
|
}
|
|
|
return serviceAPI.get('/guang/api/*/comments/add', {
|
|
|
return serviceAPI.get('guang/api/*/comments/add', {
|
|
|
article_id: id,
|
|
|
uid: uid,
|
|
|
content: comment
|
...
|
...
|
@@ -613,7 +610,7 @@ const addComment = (id, uid, comment) => { |
|
|
};
|
|
|
|
|
|
const shareData = () => {
|
|
|
return serviceAPI.get('/guang/api/*/share/guang', {}).then((result) => {
|
|
|
return serviceAPI.get('guang/api/*/share/guang', {}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
return camelCase(result.data);
|
|
|
} else {
|
...
|
...
|
|