mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-07 18:06:47 +08:00
96 lines
1.7 KiB
JavaScript
96 lines
1.7 KiB
JavaScript
/* 评论的相关处理*/
|
||
import ajax from '@/utils/xajax.js'
|
||
|
||
/*
|
||
查询评论
|
||
get post请求都可以,
|
||
@param(Object) query
|
||
pageIndex页数,
|
||
pageSize每页展示多少行
|
||
type 评论类型 可以是课程,文章
|
||
id 对象id
|
||
clevel 一级评论或者二级回复
|
||
author 当前用户id
|
||
*/
|
||
const pageQuery=function(query){
|
||
return ajax.post('/xboe/m/comment/page',query);
|
||
}
|
||
/*
|
||
查询@我的
|
||
get post请求都可以
|
||
@param(Object) query
|
||
pageIndex页数,
|
||
pageSize每页展示多少行
|
||
type 评论类型 可以是课程,文章
|
||
send 姓名
|
||
|
||
*/
|
||
const pagelist=function(query){
|
||
return ajax.post('/xboe/m/comment/tome/page',query);
|
||
}
|
||
const mobilepage=function(query){
|
||
return ajax.post('/xboe/m/comment/tome/mobilepage',query);
|
||
}
|
||
/*
|
||
保存评论
|
||
{Object }
|
||
*/
|
||
const add=function(data){
|
||
return ajax.postJson('/xboe/m/comment/add',data);
|
||
}
|
||
/* 修改评论
|
||
@param
|
||
id 当前评论id,
|
||
content,修改的内容
|
||
*/
|
||
const update=function(id,content){
|
||
return ajax.post(`/xboe/m/comment/update?id=${id}&content=${content}`);
|
||
}
|
||
/*
|
||
*param
|
||
*id,评论id
|
||
*user 当前账户id
|
||
*/
|
||
const del=function(id,user){
|
||
return ajax.del(`/xboe/m/comment/delete?id=${id}&user=${user}`);
|
||
}
|
||
|
||
/**
|
||
* 回复评论
|
||
* @param {Object} data
|
||
*/
|
||
const reply=function(data){
|
||
return ajax.postJson('/xboe/m/comment/reply',data);
|
||
}
|
||
|
||
/**
|
||
* 分页查询
|
||
* @param {Object} data
|
||
*/
|
||
const replyList=function(data){
|
||
return ajax.post('/xboe/m/comment/reply-page',data);
|
||
}
|
||
|
||
/*
|
||
*param
|
||
*id,评论id
|
||
*user 当前账户id
|
||
pid:所属回复的id
|
||
*/
|
||
const delReply=function(data){
|
||
return ajax.post('/xboe/m/comment/delete-reply',data);
|
||
}
|
||
|
||
|
||
export default{
|
||
del,
|
||
update,
|
||
add,
|
||
pagelist,
|
||
pageQuery,
|
||
reply,
|
||
replyList,
|
||
delReply,
|
||
mobilepage
|
||
}
|