A2integral.ts 709 B

1234567891011121314151617181920212223242526
  1. import http from "@/utils/http";
  2. import { AppDispatch } from "..";
  3. import { A2tableType } from "@/types";
  4. /**
  5. * 获取 积分管理(用户活跃、爱心林场) 列表
  6. */
  7. export const A2_APIgetList = () => {
  8. return async (dispatch: AppDispatch) => {
  9. const res = await http.get("cms/rule/getList");
  10. if (res.code === 0) {
  11. const list: A2tableType[] = res.data;
  12. const obj = {
  13. list1: list.filter((v) => v.type === "user"),
  14. list2: list.filter((v) => v.type === "game"),
  15. };
  16. dispatch({ type: "A2/getList", payload: obj });
  17. }
  18. };
  19. };
  20. /**
  21. * 编辑爱心币和天数
  22. */
  23. export const A2_APIsave = (data:any) => {
  24. return http.post('cms/rule/save',data);
  25. };