public.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2025 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. import {
  13. toLogin,
  14. checkLogin
  15. } from '../libs/login';
  16. /**
  17. * 获取微信公众号js配置
  18. * @returns {*}
  19. */
  20. export function getWechatConfig() {
  21. return request.get("wechat/get/public/js/config",{ url: encodeURIComponent(wechat.signLink()) },{ noAuth: true });
  22. }
  23. /**
  24. * 获取微信sdk配置
  25. * @returns {*}
  26. */
  27. export function wechatAuth(code, spread) {
  28. var reg=/^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 ,判断正整数用/^[1-9]+[0-9]*]*$/
  29. spread = reg.test(spread) ? spread : 0;
  30. return request.post(
  31. "login/wechat/public", {code:code,spreadPid:spread},
  32. { noAuth: true }
  33. );
  34. }
  35. /**
  36. * 获取登录授权login
  37. *
  38. */
  39. export function loginConfigApi()
  40. {
  41. return request.get('login/config', {}, { noAuth : true});
  42. }
  43. /**
  44. * 小程序用户登录
  45. * @param data object 小程序用户登录信息
  46. */
  47. export function login(data) {
  48. return request.post("login/wechat/routine", data, { noAuth : true });
  49. }
  50. /**
  51. * 分享
  52. * @returns {*}
  53. */
  54. export function getShare() {
  55. return request.get("share", {}, { noAuth: true });
  56. }
  57. /**
  58. * 获取关注海报
  59. * @returns {*}
  60. */
  61. export function follow() {
  62. return request.get("wechat/follow", {}, { noAuth: true });
  63. }
  64. /**
  65. * 获取图片base64
  66. * @retins {*}
  67. * */
  68. export function imageBase64(image) {
  69. return request.post("qrcode/url/to/base64",image,{ noAuth: true });
  70. }
  71. /**
  72. * 自动复制口令功能
  73. * @returns {*}
  74. */
  75. export function copyWords() {
  76. return request.get("copy_words", {}, { noAuth: true });
  77. }
  78. /**
  79. * 微信(公众号,小程序)绑定手机号
  80. * @param {Object} data
  81. */
  82. export function getUserPhone(data){
  83. return request.post('login/wechat/register/binding/phone',data,{noAuth : true});
  84. }
  85. /**
  86. * APP微信登录
  87. * @param {Object} data
  88. */
  89. export function appAuth(data) {
  90. return request.post("login/wechat/app/login", data, { noAuth : true });
  91. }
  92. /**
  93. * 苹果登录
  94. * @param {Object} data
  95. */
  96. export function appleLogin(data) {
  97. return request.post("login/ios/login", data, { noAuth : true });
  98. }
  99. /**
  100. * 苹果绑定手机号
  101. * @param {Object} data
  102. */
  103. export function iosBinding(data) {
  104. return request.post("ios/binding/phone", data, { noAuth : true });
  105. }
  106. /**
  107. * 微信地址导入
  108. * @param {Object} data
  109. */
  110. export function addressWxImportApi(data) {
  111. return request.post("address/wechant/import", data);
  112. }
  113. /**
  114. * 微信直播间列表
  115. * @param {Object} data
  116. */
  117. export function liveroomApi(data) {
  118. return request.get("wechat/liveroom", data, { noAuth : true });
  119. }
  120. /**
  121. * 全局配置信息
  122. */
  123. export function globalConfigApi() {
  124. return request.get("index/global/config/info", {}, { noAuth : true });
  125. }