Skip to content

Commit

Permalink
feat: single
Browse files Browse the repository at this point in the history
  • Loading branch information
zixuan1986 committed Aug 17, 2023
1 parent e903c25 commit ac10f42
Show file tree
Hide file tree
Showing 2 changed files with 614 additions and 6 deletions.
41 changes: 40 additions & 1 deletion src/service/body.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ function getBodyList(params) {
return $next().get("/api/pvxbody", { params });
}

function getOneBodyInfo(id) {
return $next().get(`/api/pvxbody/${id}`);
}

// 设置精选
function setStar(id) {
return $next().put(`/api/pvxbody/${id}/manager/set/star`);
Expand Down Expand Up @@ -51,7 +55,38 @@ function setPost(id, data) {
return $cms().put(`/api/cms/post/${id}/setting`, data);
}

// 获取附件列表
function getAccessoryList(postId, params) {
return $next().get(`/api/charge_attachment/pvxbody/${postId}`, {
params: params,
});
}
// 获取下载地址
function getDownUrl(postId, uuid) {
return $next().get(`/api/charge_attachment/download/pvxbody/${postId}/${uuid}`);
}

function getRandomFace(params) {
return $next().get(`/api/pvxbody/random`, {
params: params,
});
}

function getSliders(type, client, per = 10, source_ids) {
let _params = {
client: client,
type: type,
source_type: "body",
};
if (per) _params.per = per;
if (source_ids) _params.source_ids = source_ids;
return $cms({ mute: true }).get(`/api/cms/news/v2`, {
params: _params,
});
}

export {
getOneBodyInfo,
getBodyList,
setStar,
cancelStar,
Expand All @@ -60,5 +95,9 @@ export {
deleteBody,
payBody,
loopPayStatus,
setPost
setPost,
getAccessoryList,
getRandomFace,
getDownUrl,
getSliders
};
Loading

0 comments on commit ac10f42

Please sign in to comment.