channel.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import request from '@/utils/request'
  2. // 创建支付渠道
  3. export function createChannel(data) {
  4. return request({
  5. url: '/pay/channel/create',
  6. method: 'post',
  7. data: data
  8. })
  9. }
  10. // 更新支付渠道
  11. export function updateChannel(data) {
  12. return request({
  13. url: '/pay/channel/update',
  14. method: 'put',
  15. data: data
  16. })
  17. }
  18. // 删除支付渠道
  19. export function deleteChannel(id) {
  20. return request({
  21. url: '/pay/channel/delete?id=' + id,
  22. method: 'delete'
  23. })
  24. }
  25. // 获得支付渠道
  26. export function getChannel(id) {
  27. return request({
  28. url: '/pay/channel/get?id=' + id,
  29. method: 'get'
  30. })
  31. }
  32. // 获得支付渠道分页
  33. export function getChannelPage(query) {
  34. return request({
  35. url: '/pay/channel/page',
  36. method: 'get',
  37. params: query
  38. })
  39. }
  40. // 导出支付渠道Excel
  41. export function exportChannelExcel(query) {
  42. return request({
  43. url: '/pay/channel/export-excel',
  44. method: 'get',
  45. params: query,
  46. responseType: 'blob'
  47. })
  48. }
  49. // 创建微信支付渠道
  50. export function createWechatChannel(data) {
  51. return request({
  52. url: '/pay/channel/create-wechat',
  53. method: 'post',
  54. data: data
  55. })
  56. }
  57. // 获得支付渠道
  58. export function getWechatChannel(merchantId,appId,code) {
  59. return request({
  60. url: '/pay/channel/get-wechat',
  61. params:{
  62. merchantId:merchantId,
  63. appId:appId,
  64. code:code
  65. },
  66. method: 'get'
  67. })
  68. }
  69. // 更新支付渠道
  70. export function updateWechatChannel(data) {
  71. return request({
  72. url: '/pay/channel/update-wechat',
  73. method: 'put',
  74. data: data
  75. })
  76. }