From 8a709ba6db50831048f9c3e2452ea6dc6c3de36f Mon Sep 17 00:00:00 2001 From: Bang Hu <hu_bang@hotmail.com> Date: 星期五, 12 九月 2025 15:45:33 +0800 Subject: [PATCH] bug修改代码提交 --- src/api/pointsApi.ts | 28 +++++++++++++++++++++++++++- 1 files changed, 27 insertions(+), 1 deletions(-) diff --git a/src/api/pointsApi.ts b/src/api/pointsApi.ts index 6d8ec43..3c1e0e4 100644 --- a/src/api/pointsApi.ts +++ b/src/api/pointsApi.ts @@ -27,7 +27,7 @@ // 淇濆瓨绉垎瑙勫垯閰嶇疆 savePointsRules(data: object): ApiPromise { return createAxios({ - url: `${url}rules/update`, + url: `${url}rule/update`, data: data, }) as ApiPromise }, @@ -89,6 +89,32 @@ method: 'get', }) as ApiPromise }, + + // 鑾峰彇鐢ㄦ埛绉垎浣欓 - 浣跨敤宸插瓨鍦ㄧ殑鎺ュ彛 + getUserPoints(userId: number): ApiPromise { + return createAxios({ + url: `${url}total/user/${userId}`, // 淇敼涓哄疄闄呭瓨鍦ㄧ殑璺緞 + method: 'get', + }) as ApiPromise + }, + + // 浣跨敤涓撻棬鐨勭Н鍒嗘墸鍑忔帴鍙� + deductPointsByFlow(userId: string, unitId: string, points: number, orderId: string, remark?: string, dataCategory?: string, providerId?: String): ApiPromise { + return createAxios({ + url: `${url}user/deduct`, // 浣跨敤鏂扮殑涓撻棬绉垎鎵e噺鎺ュ彛 + method: 'post', + data: { + userId, + unitId, + points, // 鐩存帴浼犲叆瑕佹墸鍑忕殑绉垎鏁伴噺 + orderId, + remark: remark || `璁㈠崟${orderId}浜ゆ槗鎵e噺绉垎`, + dataCategory: dataCategory || 'resource_transaction', + dataType: 1, // 1琛ㄧず娑堣�� + providerId: providerId + }, + }) as ApiPromise + }, } export default pointsApi -- Gitblit v1.8.0