index.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. import { useLoginStore, useAccountStore } from '@/stores'
  2. import http from '@/services/http'
  3. import { RequestConfig } from '@/services/http/types'
  4. const loginStore = useLoginStore()
  5. const accountStore = useAccountStore()
  6. /**
  7. * 账户资金信息请求
  8. */
  9. export function accountFundInfoReq(config: RequestConfig<Proto.AccountFundInfoReq>) {
  10. return http.mqRequest<Proto.AccountFundInfoRsp>({
  11. data: config.data,
  12. requestCode: 'AccountFundInfoReq',
  13. responseCode: 'AccountFundInfoRsp',
  14. })
  15. }
  16. /**
  17. * 银行签约
  18. */
  19. export function t2bBankSign(config: RequestConfig<Partial<Proto.t2bBankSignReq>>) {
  20. return http.mqRequest<Proto.t2bBankSignRsp>({
  21. data: config.data,
  22. requestCode: 't2bBankSignReq',
  23. responseCode: 't2bBankSignRsp',
  24. })
  25. }
  26. /**
  27. * 短信验证码请求
  28. */
  29. export function t2bSMSVerificationCode(config: RequestConfig<Partial<Proto.t2bSWSVerificationCodeReq>>) {
  30. return http.mqRequest<Proto.t2bSWSVerificationCodeRsp>({
  31. data: config.data,
  32. requestCode: 't2bSMSVerificationCodeReq',
  33. responseCode: 't2bSMSVerificationCodeRsp',
  34. })
  35. }
  36. /**
  37. * 银行解约
  38. */
  39. export function t2bBankCancelSign(config: RequestConfig<Partial<Proto.t2bBankCancelSignReq>>) {
  40. return http.mqRequest<Proto.t2bBankCancelSignRsp>({
  41. data: config.data,
  42. requestCode: 't2bBankCancelSignReq',
  43. responseCode: 't2bBankCancelSignRsp',
  44. })
  45. }
  46. /**
  47. * 出金申请
  48. */
  49. export function t2bBankWithdraw(config: RequestConfig<Partial<Proto.t2bBankWithdrawReq>>) {
  50. return http.mqRequest<Proto.t2bBankWithdrawRsp>({
  51. data: config.data,
  52. requestCode: 't2bBankWithdrawReq',
  53. responseCode: 't2bBankWithdrawRsp',
  54. })
  55. }
  56. /**
  57. * 入金申请
  58. */
  59. export function t2bBankDeposit(config: RequestConfig<Partial<Proto.t2bBankDepositReq>>) {
  60. return http.mqRequest<Proto.t2bBankDepositRsp>({
  61. data: config.data,
  62. requestCode: 't2bBankDepositReq',
  63. responseCode: 't2bBankDepositRsp',
  64. })
  65. }
  66. /**
  67. * 查询托管银行
  68. */
  69. export function queryCusBankSignBank(config: RequestConfig = {}) {
  70. return http.commonRequest<Model.CusBankSignBankRsp[]>({
  71. url: '/Qhj/QueryCusBankSignBank',
  72. params: config.data,
  73. })
  74. }
  75. /**
  76. * 查询开户行
  77. */
  78. export function queryBankInfo(config: RequestConfig = {}) {
  79. return http.commonRequest<Model.BankInfoRsp[]>({
  80. url: '/Qhj/QueryBankInfo',
  81. params: config.data,
  82. })
  83. }
  84. /**
  85. * 查询签约银行信息(提现账户管理)
  86. */
  87. export function queryBankAccountSign(config: RequestConfig<Model.BankAccountSignReq> = {}) {
  88. return http.commonRequest<Model.BankAccountSignRsp[]>({
  89. url: '/Qhj/QueryBankAccountSign',
  90. params: {
  91. userid: loginStore.userId,
  92. ...config.data
  93. },
  94. })
  95. }
  96. /**
  97. * 查询充值提现
  98. */
  99. export function queryAccountInOutApply(config: RequestConfig<Model.AccountInOutApplyReq> = {}) {
  100. return http.commonRequest<Model.AccountOutInApplyRsp[]>({
  101. url: '/Qhj/QueryAccountInOutApply',
  102. params: config.data,
  103. })
  104. }
  105. /**
  106. * 资金流水查询(历史)
  107. */
  108. export function queryHisAmountLog(config: RequestConfig<Model.HisAmountLogReq> = {}) {
  109. return http.commonRequest<Model.HisAmountLogRsp[]>({
  110. url: '/TaAccount/QueryHisAmountLog',
  111. params: {
  112. accountID: accountStore.currentAccountId.toString(),
  113. pageflag: 1,
  114. ...config.data
  115. },
  116. })
  117. }
  118. /**
  119. * 资金流水查询(当前)
  120. */
  121. export function queryAmountLog(config: RequestConfig<Model.AmountLogReq> = {}) {
  122. return http.commonRequest<Model.AmountLogRsp[]>({
  123. url: '/TaAccount/QueryAmountLog',
  124. params: {
  125. accountID: accountStore.currentAccountId.toString(),
  126. pageflag: 1,
  127. ...config.data
  128. },
  129. })
  130. }
  131. /**
  132. * 查询托管银行扩展配置信息
  133. */
  134. export function queryBankCusBankExtendConfigs(config: RequestConfig<Model.BankCusBankExtendConfigReq> = {}) {
  135. return http.commonRequest<Model.BankCusBankExtendConfigRsp[]>({
  136. url: '/Bank/QueryBankCusBankExtendConfigs',
  137. params: {
  138. ...config.data
  139. },
  140. })
  141. }