feat: 添加订单详情和退款功能,更新用户角色管理,增强超级管理员鉴权

This commit is contained in:
2025-12-24 09:48:31 +08:00
parent fcbc6bd394
commit 1e1132718c
17 changed files with 586 additions and 6 deletions

View File

@@ -71,5 +71,20 @@ export const OrderService = {
},
async getOrderStatistics() {
return requestJson('/super/v1/orders/statistics');
},
async getOrderDetail(orderID) {
if (!orderID) throw new Error('orderID is required');
return requestJson(`/super/v1/orders/${orderID}`);
},
async refundOrder(orderID, { force, reason, idempotency_key } = {}) {
if (!orderID) throw new Error('orderID is required');
return requestJson(`/super/v1/orders/${orderID}/refund`, {
method: 'POST',
body: {
force: Boolean(force),
reason,
idempotency_key
}
});
}
};

View File

@@ -77,6 +77,11 @@ export const UserService = {
throw error;
}
},
async updateUserRoles({ userID, roles }) {
if (!userID) throw new Error('userID is required');
if (!Array.isArray(roles) || roles.length === 0) throw new Error('roles is required');
return requestJson(`/super/v1/users/${userID}/roles`, { method: 'PATCH', body: { roles } });
},
async getUserStatistics() {
try {
const data = await requestJson('/super/v1/users/statistics');