common.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. import request from "@/utils/request"
  2. // 微信用户注册
  3. export const weChatRegister = (data) => {
  4. return request({
  5. url: '/api/parse/wechat-register',
  6. method: "POST",
  7. data,
  8. custom: {
  9. showLoading: false,
  10. showError: true
  11. }
  12. })
  13. }
  14. // 刷新令牌
  15. export const refreshToken = (refreshToken) => {
  16. return request({
  17. url: '/app-api/menduner/system/auth/refresh-token',
  18. method: "POST",
  19. params: {
  20. refreshToken
  21. },
  22. custom: {
  23. showLoading: false,
  24. showError: false
  25. }
  26. })
  27. }
  28. // 短信登录
  29. export const smsLogin = (data) => {
  30. return request({
  31. url: '/app-api/menduner/system/auth/sms-login',
  32. method: 'POST',
  33. data,
  34. custom: {
  35. showLoading: false
  36. }
  37. })
  38. }
  39. // 微信小程序的一键登录
  40. export const weChatLogin = (data) => {
  41. return request({
  42. url: '/app-api/menduner/system/auth/weixin-mini-app-login',
  43. method: 'POST',
  44. data,
  45. custom: {
  46. showLoading: false
  47. }
  48. })
  49. }
  50. // 密码登录
  51. export const passwordLogin = (data) => {
  52. return request({
  53. url: '/app-api/menduner/system/auth/login',
  54. method: 'POST',
  55. data,
  56. custom: {
  57. showLoading: false
  58. }
  59. })
  60. }
  61. // 招聘端-退出登录
  62. export const logout = (token) => {
  63. return request({
  64. url: `/app-api/menduner/system/recruit/enterprise/auth/logout-token?token=${token}`,
  65. method: 'POST',
  66. custom: {
  67. showLoading: false,
  68. auth: true
  69. }
  70. })
  71. }
  72. // 内容管理-广告
  73. export const getWebContent = async () => {
  74. return request({
  75. url: `/app-api/menduner/system/web-content/get?id=1`,
  76. method: 'GET',
  77. custom: {
  78. showLoading: false,
  79. auth: false
  80. }
  81. })
  82. }
  83. // 求职端交易订单 创建
  84. export const orderCreated = async (data) => {
  85. return request({
  86. // url: '/app-api/menduner/system/trade/order/create',
  87. url: '/app-api/menduner/system/trade/order/wx-program/create',
  88. method: 'POST',
  89. data,
  90. custom: {
  91. openEncryption: true,
  92. showLoading: false,
  93. auth: true
  94. }
  95. })
  96. }
  97. // 求职端交易订单 创建
  98. export const getOrder = async (params) => {
  99. return request({
  100. url: '/app-api/menduner/system/trade/order/get/unpaid',
  101. method: 'GET',
  102. params,
  103. custom: {
  104. showLoading: false,
  105. auth: true
  106. }
  107. })
  108. }
  109. // 获得社交用户
  110. export const getSocialUser = async (type) => {
  111. return request({
  112. url: `/app-api/menduner/system/social-user/get?type=${type}`,
  113. method: 'GET',
  114. // params,
  115. custom: {
  116. showLoading: false,
  117. auth: true
  118. }
  119. })
  120. }
  121. // 获得支付订单 (轮巡支付状态)
  122. export const getOrderPayStatus = async (params) => {
  123. return request({
  124. url: '/app-api/pay/order/get',
  125. method: 'GET',
  126. params,
  127. custom: {
  128. showLoading: false,
  129. auth: true
  130. }
  131. })
  132. }
  133. // 获得指定应用的开启的支付渠道编码列表
  134. export const getEnableCodeList = async (params) => {
  135. return request({
  136. url: '/app-api/pay/channel/get-enable-code-list',
  137. method: 'GET',
  138. params,
  139. custom: {
  140. showLoading: false,
  141. auth: true
  142. }
  143. })
  144. }
  145. // 提交支付订单
  146. export const payOrderSubmit = async (data) => {
  147. return request({
  148. url: '/app-api/pay/order/submit',
  149. method: 'POST',
  150. data,
  151. custom: {
  152. showLoading: false,
  153. auth: true
  154. }
  155. })
  156. }
  157. // 社交绑定,使用 code 授权码
  158. export const socialUserBind = async (data) => {
  159. return request({
  160. url: '/app-api/menduner/system/social-user/bind',
  161. method: 'POST',
  162. data: {...data, application: 'recruit_application'}, // 增加一个application参数,招聘端的值如上,不填默认null后台自动认为是求职端小程序
  163. custom: {
  164. showLoading: false,
  165. auth: true
  166. }
  167. })
  168. }