Files
learning-system-mobile/api/modules/praises.js
2022-05-29 18:59:24 +08:00

30 lines
791 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* 点赞的相关处理*/
import ajax from '@/utils/xajax.js'
/*点赞
* objType点赞对象类型 1课程 2文章,3案例, 4问答
* objId 点赞对象id
* title 点赞对象标题
*
*/
const save=function(data){
return ajax.post('/xboe/m/praise/add',data);
}
// 是否已经点赞
// objType点赞对象类型 1课程 2文章,3案例, 4问答
// objId 点赞对象id
const has=function(objType,objId){
return ajax.post(`/xboe/m/praise/has?objType=${objType}&objId=${objId}`)
}
//取消点赞
// objType点赞对象类型 1课程 2文章,3案例, 4问答
// objId 点赞对象id
const remove=function(objType,objId){
return ajax.post(`/xboe/m/praise/remove?objType=${objType}&objId=${objId}`)
}
export default{
save,
remove,
has
}