2025-09-15
This commit is contained in:
65
api/transfer.js
Normal file
65
api/transfer.js
Normal file
@@ -0,0 +1,65 @@
|
||||
import {
|
||||
http
|
||||
} from "../util/api";
|
||||
|
||||
|
||||
// 转账相关API
|
||||
export const transferAPI = {
|
||||
// 获取公户信息
|
||||
getPublicAccount: () => http.get('/transfers/public-account'),
|
||||
|
||||
// 创建转账记录
|
||||
create: (data) => {
|
||||
const formData = new FormData()
|
||||
Object.keys(data).forEach(key => {
|
||||
formData.append(key, data[key])
|
||||
})
|
||||
return http.post('/transfers', data)
|
||||
},
|
||||
|
||||
// 确认转账
|
||||
confirm: (id) => http.put(`/transfers/${id}/confirm`),
|
||||
|
||||
// 拒绝转账
|
||||
reject: (id) => http.put(`/transfers/${id}/reject`),
|
||||
|
||||
// 确认收款
|
||||
confirmReceived: (id) => http.post('/transfers/confirm-received', {
|
||||
transfer_id: id
|
||||
}),
|
||||
|
||||
// 确认未收到款
|
||||
confirmNotReceived: (id) => http.post('/transfers/confirm-not-received', {
|
||||
transfer_id: id
|
||||
}),
|
||||
|
||||
// 获取用户转账记录
|
||||
getUserTransfers: (params = {}) => http.get('/transfers/user', {
|
||||
params
|
||||
}),
|
||||
|
||||
// 获取指定用户的转账记录
|
||||
getUserTransfersByUserId: (userId, params = {}) => http.get(`/transfers/user/${userId}`, {
|
||||
params
|
||||
}),
|
||||
|
||||
// 获取待确认转账
|
||||
getPendingTransfers: (params = {}) => http.get('/transfers/pending', {
|
||||
params
|
||||
}),
|
||||
|
||||
// 获取用户账户信息
|
||||
getUserAccount: () => http.get('/transfers/account'),
|
||||
|
||||
// 获取转账列表(管理员)
|
||||
getList: (params = {}) => http.get('/transfers', {
|
||||
params
|
||||
}),
|
||||
|
||||
// 获取转账统计
|
||||
getStats: () => http.get('/transfers/stats')
|
||||
}
|
||||
|
||||
export default {
|
||||
transferAPI
|
||||
}
|
||||
Reference in New Issue
Block a user