public.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. import request from "@/utils/request.js";
  11. import wechat from "@/libs/wechat.js";
  12. /**
  13. * 获取微信sdk配置
  14. * @returns {*}
  15. */
  16. export function getWechatConfig() {
  17. return request.get(
  18. "wechat/config", {
  19. url: wechat.signLink()
  20. }, {
  21. noAuth: true
  22. }
  23. );
  24. }
  25. /**
  26. * 获取微信sdk配置
  27. * @returns {*}
  28. */
  29. export function wechatAuth(code, spread, login_type) {
  30. return request.get(
  31. "auth/wechat", {
  32. code,
  33. spread,
  34. login_type
  35. }, {
  36. noAuth: true
  37. }
  38. );
  39. }
  40. export function commonAuth(data) {
  41. return request.post(
  42. "auth", data, {
  43. noAuth: true
  44. }
  45. );
  46. }
  47. /**
  48. * 获取登录授权login
  49. *
  50. */
  51. export function getLogo() {
  52. return request.get('wechat/get_logo', {}, {
  53. noAuth: true
  54. });
  55. }
  56. /**
  57. * 小程序用户登录
  58. * @param data object 小程序用户登陆信息
  59. */
  60. export function login(data) {
  61. return request.post("auth/mp", data, {
  62. noAuth: true
  63. });
  64. }
  65. /**
  66. * 分享
  67. * @returns {*}
  68. */
  69. export function getShare() {
  70. return request.get("share", {}, {
  71. noAuth: true
  72. });
  73. }
  74. /**
  75. * 获取关注海报
  76. * @returns {*}
  77. */
  78. export function follow() {
  79. return request.get("wechat/follow", {}, {
  80. noAuth: true
  81. });
  82. }
  83. /**
  84. * 获取图片base64
  85. * @retins {*}
  86. * */
  87. export function imageBase64(image, code) {
  88. return request.post(
  89. "common/base64", {
  90. image: image,
  91. code: code
  92. }, {
  93. noAuth: true
  94. }
  95. );
  96. }
  97. // 配置
  98. export function getconfig(data) {
  99. return request.get("config",data,{noAuth: true});
  100. }
  101. // 浏览记录
  102. export function history(data) {
  103. return request.post("common/visit",data);
  104. }
  105. export function getSubscribe(){
  106. return request.get("subscribe", {}, {
  107. noAuth: true
  108. });
  109. }
  110. export function getVersion() {
  111. return request.get("version",{},{noAuth: true});
  112. }
  113. /**
  114. * 获取组件底部菜单
  115. * @param data object 获取组件底部菜单
  116. */
  117. export function getNavigation(data) {
  118. return request.get("navigation", data, {
  119. noAuth: true
  120. });
  121. }