app.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. import request from '@/utils/request'
  2. import wechath5 from '@/utils/wechath5'
  3. import {
  4. client
  5. } from '@/utils/tools'
  6. //获取app版本号
  7. export function version(data) {
  8. return request.post('index/version');
  9. }
  10. //小程序授权登录
  11. export function authLogin(data) {
  12. return request.post('account/authLogin', data);
  13. }
  14. //小程序静默登录
  15. export function silentLogin(data) {
  16. return request.post('account/silentLogin', data);
  17. }
  18. // app登录
  19. export function opLogin(data) {
  20. return request.post('account/uinAppLogin', {
  21. ...data,
  22. client
  23. });
  24. }
  25. //预支付接口
  26. export function prepay(data) {
  27. return request.post('pay/unifiedpay', {
  28. ...data,
  29. });
  30. }
  31. //小程序订阅
  32. export function getMnpNotice(data) {
  33. return request.get("subscribe/lists", {
  34. params: data
  35. });
  36. }
  37. //账号登录
  38. export function accountLogin(data) {
  39. return request.post("account/login", {
  40. ...data,
  41. client
  42. })
  43. }
  44. // 登录
  45. export function wechatLogin(data) {
  46. return request.post('account/oalogin', data)
  47. }
  48. // 向微信请求code的链接
  49. export function getCodeUrl(params) {
  50. return request.get('account/codeurl', {
  51. params: {
  52. url: encodeURIComponent(location.href)
  53. }
  54. });
  55. }
  56. //微信sdk配置
  57. export function getJsconfig() {
  58. return request.get('wechat/jsconfig', {
  59. params: {
  60. url: encodeURIComponent(wechath5.signLink())
  61. }
  62. });
  63. }
  64. // 忘记密码
  65. export function forgetPwd(data) {
  66. return request.post('login_password/forget', {
  67. ...data,
  68. client
  69. })
  70. }
  71. // 发送短信
  72. export function sendSms(data) {
  73. return request.post('sms/send', {
  74. ...data,
  75. client
  76. })
  77. }
  78. // Html5 注册账号
  79. export function register(data) {
  80. return request.post('account/register', {
  81. ...data,
  82. client
  83. })
  84. }
  85. // 获取服务协议
  86. export function getServerProto() {
  87. return request.get("policy/service")
  88. }
  89. // 获取隐私政策
  90. export function getPrivatePolicy() {
  91. return request.get("policy/privacy")
  92. }
  93. // 获取售后保障
  94. export function getAfterSaleGuar() {
  95. return request.get("policy/afterSale")
  96. }
  97. //客服
  98. export function getService() {
  99. return request.get("setting/getPlatformCustomerService")
  100. }
  101. //客服配置
  102. export function getChatConfig(params) {
  103. return request.get("index/chatConfig", {
  104. params
  105. })
  106. }
  107. // 足迹气泡
  108. export function getBubbleLists() {
  109. return request.get("footprint/lists")
  110. }
  111. // 验证码登录
  112. export function smsCodeLogin(data) {
  113. return request.post('account/smsLogin', {
  114. ...data,
  115. client
  116. })
  117. }
  118. export function getConfig() {
  119. return request.get("index/config")
  120. }
  121. // 注册赠送优惠券
  122. export function getRegisterCoupon() {
  123. return request.get('coupon/registerSendCoupon')
  124. }
  125. // 获取支付配置
  126. export function getPayway(params) {
  127. return request.get('order/getPayWay', {
  128. params
  129. })
  130. }
  131. // 小程序码
  132. export function apiMnpQrCode(params) {
  133. return request.get('share/getMnQrcode', {
  134. params
  135. })
  136. }