import http from "@/utils/http";
import { AppDispatch } from "..";
/**
 * 获取 用户管理 列表
 */
export const A1_APIgetList = (data: any) => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post("cms/user/pageList", data);
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total,
      };
      dispatch({ type: "A1/getList", payload: obj });
    }
  };
};

/**
 * 通过id获取积分详情
 */
export const A1_APIgetInfo = (userId: number) => {
  return http.get(`cms/user/point/getList/${userId}`);
};

/**
 * 修改爱心币
 */
export const A1_APIsetNum = (data:any) => {
  return http.post('cms/user/point/add',data);
};
