| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import {
- useCommentServer
- } from '@/config/server-info'
- import axios from '@/plugins/axios'
- export function createComment ({ slideId, pageNumber, title, content }) {
- const data = {
- slideId,
- pageNumber,
- title,
- content
- }
- return axios
- .post(useCommentServer(), data)
- .then(res => res.data)
- }
- export function removeComment ({ commentId }) {
- return axios
- .delete(useCommentServer('/' + commentId))
- .then(res => {})
- }
- export function topComment ({ commentId }) {
- return axios
- .post(useCommentServer('/' + commentId + '/top'))
- .then(res => {})
- }
- export function unTopComment ({ commentId }) {
- return axios
- .post(useCommentServer('/' + commentId + '/unTop'))
- .then(res => {})
- }
- export function getComments ({ slideId, pageNumber, key = '', page = 0, size = 10, sort = '' }) {
- return axios
- .get(useCommentServer('/slide/' + slideId), {
- params: {
- pageNumber,
- key,
- page,
- size,
- sort
- }
- })
- .then(res => res.data)
- }
|