小程序端工程代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
1.9 KiB

  1. import request from "@/utils/request";
  2. /**
  3. * 首页
  4. * @returns {*}
  5. */
  6. export function getHomeData() {
  7. return request.get("index", {}, { login: false });
  8. }
  9. /**
  10. * 首页
  11. * @returns {*}
  12. */
  13. export function getCanvas() {
  14. return request.get("/getCanvas?terminal=3", {}, { login: false });
  15. }
  16. /**
  17. * 文章 轮播列表
  18. * @returns {*}
  19. */
  20. export function getArticleBanner() {
  21. return request.get("/article/banner/list", {}, { login: false });
  22. }
  23. /**
  24. * 文章分类列表
  25. * @returns {*}
  26. */
  27. export function getArticleCategory() {
  28. return request.get("/article/category/list", {}, { login: false });
  29. }
  30. /**
  31. * 文章 热门列表
  32. * @returns {*}
  33. */
  34. export function getArticleHotList() {
  35. return request.get("/article/hot/list", {}, { login: false });
  36. }
  37. /**
  38. * 文章列表
  39. * @returns {*}
  40. */
  41. export function getArticleList(q) {
  42. return request.get("/article/list/", q, { login: false });
  43. }
  44. /**
  45. * 分享
  46. * @returns {*}
  47. */
  48. export function getShare() {
  49. return request.get("/share", {}, { login: false });
  50. }
  51. /**
  52. * 文章详情
  53. * @returns {*}
  54. */
  55. export function getArticleDetails(id) {
  56. return request.get("/article/details/" + id, {}, { login: false });
  57. }
  58. /**
  59. * 获取微信sdk配置
  60. * @returns {*}
  61. */
  62. export function getWechatConfig() {
  63. return request.get(
  64. "/wechat/config",
  65. { url: location.href },
  66. { login: false }
  67. );
  68. }
  69. /**
  70. * 获取微信sdk配置
  71. * @returns {*}
  72. */
  73. export function wechatAuth(code, spread, login_type) {
  74. return request.get(
  75. "/wechat/auth",
  76. { code, spread, login_type },
  77. { login: false }
  78. );
  79. }
  80. /**
  81. * 获取快递公司
  82. * @returns {*}
  83. */
  84. export function getLogistics() {
  85. return request.get("/logistics", {}, { login: false });
  86. }
  87. /**
  88. * 获取图片base64
  89. * @retins {*}
  90. * */
  91. export function imageBase64(image, code) {
  92. return request.post(
  93. "/image_base64",
  94. { image: image, code: code },
  95. { login: false }
  96. );
  97. }