public.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import request from "@/utils/request.js";
  2. // 获取登录授权login
  3. export function getLogo(data) {
  4. return request({
  5. url: '/api/wechat/get_logo',
  6. method: 'get',
  7. data
  8. });
  9. }
  10. /**
  11. * 获取登录授权login
  12. *
  13. */
  14. // export function getLogo()
  15. // {
  16. // return request.get('wechat/get_logo', {}, { noAuth : true});
  17. // }
  18. /**
  19. * 获取微信sdk配置
  20. * @returns {*}
  21. */
  22. export function getWechatConfig() {
  23. return request.get(
  24. "wechat/config",
  25. { url: document.location.href },
  26. { noAuth: true }
  27. );
  28. }
  29. /**
  30. * 获取微信sdk配置
  31. * @returns {*}
  32. */
  33. export function wechatAuth(code, spread, login_type) {
  34. return request.get(
  35. "wechat/auth",
  36. { code, spread, login_type },
  37. { noAuth: true }
  38. );
  39. }
  40. /**
  41. * 小程序用户登录
  42. * @param data object 小程序用户登陆信息
  43. */
  44. export function login(data) {
  45. return request.post("wechat/mp_auth", data, { noAuth : true });
  46. }
  47. /**
  48. * 分享
  49. * @returns {*}
  50. */
  51. export function getShare() {
  52. return request.get("share", {}, { noAuth: true });
  53. }
  54. /**
  55. * 获取关注海报
  56. * @returns {*}
  57. */
  58. export function follow() {
  59. return request.get("wechat/follow", {}, { noAuth: true });
  60. }
  61. /**
  62. * 获取图片base64
  63. * @retins {*}
  64. * */
  65. export function imageBase64(image, code) {
  66. return request.post(
  67. "/image_base64",
  68. { image: image, code: code },
  69. { noAuth: true }
  70. );
  71. }