common.js 3.4 KB

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