import request from "@/utils/request";
import qs from "qs";
/**
 * 发送验证码
 * @param {*} params codeType 0注册/登录验证 1修改密码 2订单通知信息
 * @param {*} param phone required 用户手机号
 * @returns
 */
export function smsCode(params) {
  const final_params = qs.stringify(params);
  return request({
    url: `/api/sms/verifyCode`,
    method: "post",
    // headers: { 'Content-Type': 'application/x-www-form-urlencoded;' },
    data: final_params
  });
}

/**
 * 上传图片 后端还在修改
 * @param {*} params files 文件
 * @param {*} params  邀请码
 */

export function uploadImage(params, file) {
  return request({
    url: "/ZX/uploadImage",
    method: "post",
    params,
    data: file
  });
}

/**
 * 版本检查
 * @param {*} version
 * @returns
 */
export function versionUpdate(params) {
  return request({
    url: "/account/version",
    method: "get",
    params
  });
}

/**
 * 获取App下载路径
 * @returns
 */
export function getAppDownUrl() {
  return request({
    url: "/account/download",
    method: "get"
  });
}
