// 场景接口

import serviceAxios from "@/http/index";

// 获取验证码
export const getCodeImg = () => {
  return serviceAxios({
    url: `/captchaImage`,
    method: "get",
  });
};

// 注册账号
export const register = (data) => {
  return serviceAxios({
    url: "/vrone/backend/vrUser/register",
    method: "post",
    data,
  });
};

// 登录账号
export const login = (data) => {
  return serviceAxios({
    url: "/vrone/backend/vrUser/login",
    method: "post",
    data: {
      phone: data.username,
      password: data.password,
    },
  });
};

// 钱包充值
export const recharge = (data) => {
  return serviceAxios({
    url: "/vrone/backend/recharges",
    method: "post",
    data,
  });
};

// 修改用户邮箱
export const updateEmail = (data) => {
  return serviceAxios({
    url: "/vrone/backend/vrUser/editEmil",
    method: "put",
    data,
  });
};

// 修改用户密码
export const updatePassword = (data) => {
  return serviceAxios({
    url: "/vrone/backend/vrUser/editPassword",
    method: "put",
    data,
  });
};

// 修改用户头像
export const updateAvatar = (data) => {
  return serviceAxios({
    url: "/vrone/backend/vrUser/editAvatar",
    method: "put",
    data,
  });
};

// 获取用户资料
export const getUserInfo = (data) => {
  return serviceAxios({
    url: "/vrone/backend/vrUser/" + data,
    method: "get",
  });
};
