import request from "@/utils/request";

export function login(data) {
  return request({
    url: "/app-api/member/login",
    method: "post",
    data,
  });
}

export function reg(data) {
  return request({
    url: "/app-api/member/reg",
    method: "post",
    data,
  });
}

export function smsLogin(data) {
  return request({
    url: "/app-api/member/sms-login",
    method: "post",
    data,
  });
}

export function resetPwd(data) {
  return request({
    url: "/app-api/member/reset-password",
    method: "post",
    data,
  });
}

export function getInfo(query) {
  return request({
    url: "/app-api/member/user/get",
    method: "get",
    params: query,
  });
}

export function getCompanyInfo(query) {
  return request({
    url: "/app-api/member/user/getCompanyInfo",
    method: "get",
    params: query,
  });
}

export function logout() {
  return request({
    url: "/vue-element-admin/user/logout",
    method: "post",
  });
}

export function getCode(data) {
  return request({
    url: "/app-api/member/send-sms-code",
    method: "post",
    data,
  });
}

export function updatePwd(data) {
  return request({
    url: "/app-api/member/update-password",
    method: "post",
    data,
  });
}

export function update(data) {
  return request({
    url: "/app-api/member/user/update",
    method: "put",
    data,
  });
}

export function createCompanyInfo(data) {
  return request({
    url: "/app-api/member/user/createCompanyInfo",
    method: "post",
    data,
  });
}

export function updateCompanyInfo(data) {
  return request({
    url: "/app-api/member/user/updateCompanyInfo",
    method: "put",
    data,
  });
}

export function getCountryList(query) {
  return request({
    url: "/app-api/ecw/country/list-all",
    method: "get",
    params: query,
  });
}

export function updateMobile(data) {
  return request({
    url: "/app-api/member/user/update-mobile",
    method: "post",
    data,
  });
}

export function authIdCard(data) {
  return request({
    url: "/app-api/member/user/auth-idcard",
    method: "put",
    data,
  });
}

export function uploadFile(data) {
  return request({
    url: "/app-api/file/upload",
    method: "post",
    data: data,
  });
}
export function upNamefile(data) {
  return request({
    url: "/app-api/file/org-name/up",
    method: "post",
    data: data,
  });
}
export function getIdCard(query) {
  return request({
    url: "/app-api/member/user/get-auth-idcard-info",
    method: "get",
    params: query,
  });
}

export function updateAvatar(data) {
  return request({
    url: "/app-api/member/user/new/update-Avatar?avatar=" + data,
    method: "put",
  });
}

export function sendEmailCode(data) {
  return request({
    url: "/app-api/member/send-email-code",
    method: "post",
    data: data,
  });
}

export function bindEmail(data) {
  return request({
    url: "/app-api/member/user/bind-email",
    method: "post",
    data: data,
  });
}

export function getMark(query) {
  return request({
    url: "/app-api/member/user/angle-mark",
    method: "get",
    params: query,
  });
}

// 重置控货密码
export function resetControlPwd(data) {
  return request({
    url: "/app-api/member/reset-control-password",
    method: "post",
    data,
  });
}

// 检查是否有设置控货密码，按订单id
export function checkControlPwd(orderId) {
  return request({
    url: "/app-api/order/order-cargo-control/controlPassword/" + orderId,
    method: "get",
  });
}

//获取城市

export function getCityListByParent(query) {
  return request({
    url: "/admin-api/ecw/region/getCityListByParent",
    method: "get",
    params: query,
  });
}

//获取国家

export function getTradeCountryList(query) {
  return request({
    url: "/admin-api/ecw/region/getTradeCountryList",
    method: "get",
    params: query,
  });
}


export function memberSystemStatus() {
  return request({
    url: "/admin-api/member/score-rule/switch/get",
    method: "get"
  });
}
