import { request } from "@/utils/request.js";

/**
 * 账号信息 API接口
 */
export default {
  /**
   * 数据列表
   * @returns
   */
  getPageList(params = {}) {
    return request({
      url: "/v1/customer/Account/index",
      method: "get",
      params,
    });
  },

  /**
   * 添加数据
   * @returns
   */
  save(params = {}) {
    return request({
      url: "/v1/customer/Account/save",
      method: "post",
      data: params,
    });
  },

  /**
   * 更新数据
   * @returns
   */
  update(id, data = {}) {
    return request({
      url: "/v1/customer/Account/update?id=" + id,
      method: "put",
      data,
    });
  },

  /**
   * 读取数据
   * @returns
   */
  read(id) {
    return request({
      url: "/v1/customer/Account/read?id=" + id,
      method: "get",
    });
  },

  /**
   * 删除数据
   * @returns
   */
  destroy(data) {
    return request({
      url: "/v1/customer/Account/destroy",
      method: "delete",
      data,
    });
  },

  /**
   * 修改密码
   * @returns
   */
  updatePwdApi(data) {
    return request({
      url: "/v1/customer/Account/updatePwd",
      method: "post",
      data,
    });
  },
  updateMobileApi(data) {
    return request({
      url: "/v1/customer/Account/updateMobile",
      method: "post",
      data,
    });
  },
  updateRealApi(data) {
    return request({
      url: "/v1/customer/Account/updateReal",
      method: "post",
      data,
    });
  },
  // 封禁列表
  getBanListApi(params = {}) {
    return request({
      url: "/v1/customer/Account/getBanList",
      method: "get",
      params,
    });
  },
  // 封禁
  saveBanApi(data) {
    return request({
      url: "/v1/customer/Account/saveBan",
      method: "post",
      data,
    });
  },
};
