p-honggang.li
5 天以前 80ca024e9ae633df0dc9f4e8f533f33b526afb3d
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
  },
@@ -99,7 +99,7 @@
  },
  // 使用专门的积分扣减接口
  deductPointsByFlow(userId: string, unitId: string, points: number, orderId: string, remark?: string, dataCategory?: string): ApiPromise {
  deductPointsByFlow(userId: string, unitId: string, points: number, orderId: string, remark?: string, dataCategory?: string, providerId?: String): ApiPromise {
    return createAxios({
      url: `${url}user/deduct`,  // 使用新的专门积分扣减接口
      method: 'post',
@@ -110,7 +110,8 @@
        orderId,
        remark: remark || `订单${orderId}交易扣减积分`,
        dataCategory: dataCategory || 'resource_transaction',
        dataType: 1               // 1表示消耗
        dataType: 1,               // 1表示消耗
        providerId: providerId
      },
    }) as ApiPromise
  },