index.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { REQUEST_CONFIG } from '@/config';
  2. import { request, handle } from '@kasite/uni-app-base';
  3. const doPost = async (url, data, options) => {
  4. data.ChannelId = 'smallpro';
  5. let resp = handle.promistHandleNew(await request.doPost(url, data, options));
  6. return handle.catchPromiseNew(resp, () => resp, options);
  7. };
  8. /** 文章详情 */
  9. export const ArticleDetail = async (saveData: any, options: any = {}) => {
  10. return doPost(
  11. `${REQUEST_CONFIG.BASE_URL}wsgw/article/mgr/ArticleDetail/callApiJSON.do`,
  12. saveData,
  13. options
  14. );
  15. };
  16. /** 点赞文章 */
  17. export const LikeArticle = async (saveData: any, options: any = {}) => {
  18. return doPost(
  19. `${REQUEST_CONFIG.BASE_URL}wsgw/article/mgr/Like/callApiJSON.do`,
  20. saveData,
  21. options
  22. );
  23. };
  24. /** 分享文章 */
  25. export const ShareArticle = async (saveData: any, options: any = {}) => {
  26. return doPost(
  27. `${REQUEST_CONFIG.BASE_URL}wsgw/article/mgr/Share/callApiJSON.do`,
  28. saveData,
  29. options
  30. );
  31. };
  32. /** 获取评论 */
  33. export const GetCommentList = async (saveData: any, options: any = {}) => {
  34. return doPost(
  35. `${REQUEST_CONFIG.BASE_URL}wsgw/article/comment/page/callApiJSON.do`,
  36. saveData,
  37. options
  38. );
  39. };
  40. /** 发布评论 */
  41. export const CreateComment = async (saveData: any, options: any = {}) => {
  42. return doPost(
  43. `${REQUEST_CONFIG.BASE_URL}wsgw/article/comment/create/callApiJSON.do`,
  44. saveData,
  45. options
  46. );
  47. };