2025-09-15
This commit is contained in:
20
api/auth.js
Normal file
20
api/auth.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { http } from "../util/api"
|
||||
|
||||
// 认证相关API
|
||||
export const authAPI = {
|
||||
// 登录
|
||||
login: (data) => http.post('/auth/login', data),
|
||||
|
||||
// 注册
|
||||
register: (data) => http.post('/auth/register', data),
|
||||
|
||||
// 获取当前用户信息
|
||||
me: () => http.get('/auth/me'),
|
||||
|
||||
// 修改密码
|
||||
changePassword: (data) => http.put('/auth/change-password', data)
|
||||
}
|
||||
|
||||
export default {
|
||||
authAPI
|
||||
}
|
||||
16
api/captcha.js
Normal file
16
api/captcha.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import {
|
||||
http
|
||||
} from "../util/api"
|
||||
|
||||
// 验证码相关API
|
||||
export const captchaAPI = {
|
||||
// 生成验证码
|
||||
generate: () => http.get('/captcha/generate'),
|
||||
|
||||
// 验证验证码
|
||||
verify: (data) => http.post('/captcha/verify', data)
|
||||
}
|
||||
|
||||
export default {
|
||||
captchaAPI
|
||||
}
|
||||
9
api/common.js
Normal file
9
api/common.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import { http } from "../util/api";
|
||||
|
||||
export const commonAPI = {
|
||||
getRegion: () => http.get('/regions/provinces'),
|
||||
}
|
||||
|
||||
export default {
|
||||
commonAPI
|
||||
}
|
||||
24
api/payment.js
Normal file
24
api/payment.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { http } from "../util/api"
|
||||
|
||||
// 支付相关API
|
||||
export const paymentAPI = {
|
||||
// 获取支付方式
|
||||
getMethods: () => http.get('/payment/methods'),
|
||||
|
||||
// 创建支付订单
|
||||
createOrder: (data) => http.post('/payment/create-order', data),
|
||||
|
||||
// 查询支付状态
|
||||
queryStatus: (outTradeNo) => http.get(`/payment/query-status/${outTradeNo}`),
|
||||
|
||||
getOrder: () => http.get('/payment/check-status'),
|
||||
|
||||
// 获取支付记录
|
||||
getOrders: (params = {}) => http.get('/payment/orders', {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
paymentAPI
|
||||
}
|
||||
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
|
||||
}
|
||||
27
api/user.js
Normal file
27
api/user.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
http
|
||||
} from "../util/api"
|
||||
|
||||
// 用户相关API
|
||||
export const userAPI = {
|
||||
// 获取用户列表
|
||||
getList: (params = {}) => http.get('/users', {
|
||||
params
|
||||
}),
|
||||
|
||||
// 获取用户详情
|
||||
getDetail: (id) => http.get(`/users/${id}`),
|
||||
|
||||
// 更新用户信息
|
||||
update: (id, data) => http.put(`/users/${id}`, data),
|
||||
|
||||
// 删除用户
|
||||
delete: (id) => http.delete(`/users/${id}`),
|
||||
|
||||
// 获取用户统计
|
||||
getStats: () => http.get('/users/stats/overview')
|
||||
}
|
||||
|
||||
export default {
|
||||
userAPI
|
||||
}
|
||||
Reference in New Issue
Block a user