import type { Login } from "@/api/interface";
import httpLogin from "@/api/indexApi";
import { Upload } from "@/api/interface/index";
// 获取图片验证码
export const getImgCode = () => {
  return httpLogin.get(
    `/alienStorePlatform/storePlatformLogin/generateCaptcha`,
    {},
    {
      responseType: "blob",
      loading: false
    }
  ); // 正常 post json 请求  ==>  application/json
};
// 获取手机验证码
export const getPhoneCode = params => {
  return httpLogin.get(`/alienStore/ali/sendSms`, params, { loading: false });
};
// 注册账号
export const registerAccount = params => {
  return httpLogin.get(`/alienStorePlatform/storePlatformLogin/register`, params, { loading: false });
};
//注册校验
export const registerCheck = params => {
  return httpLogin.get(`/alienStorePlatform/storePlatformLogin/checkRegister`, params, { loading: false });
};
//登录账号 /storePlatformLogin/login
export const loginAccount = params => {
  return httpLogin.get(`/alienStorePlatform/storePlatformLogin/login`, params, { loading: false });
};
// 忘记密码 /storePlatformLogin/updatePassword
export const forgetPassword = params => {
  return httpLogin.get(`/alienStorePlatform/storePlatformLogin/updatePassword`, params, { loading: false });
};

//经营板块
export const getBusinessSection = () => {
  return httpLogin.get(`/alienStore/store/info/getBusinessSection`);
};

//经营种类
export const getBusinessSectionTypes = (params: { parentId: string }) => {
  return httpLogin.get(`/alienStore/store/info/getBusinessSectionTypes`, params);
};
//经纬度查询
export const getInputPrompt = params => {
  return httpLogin.get(`/alienStore/gaode/getInputPrompt`, params);
};

//所在地区
export const getDistrict = params => {
  return httpLogin.get(`/alienStore/gaode/getDistrict`, params);
};
//文件上传
export const uploadImg = (params: FormData) => {
  return httpLogin.post<Upload.ResFileUrl>(`/alienStore/file/uploadMore`, params, { cancel: false });
};
//验证验证码
export const getCheckSmsCode = params => {
  return httpLogin.get(`/alienStore/ali/checkSmsCode`, params);
};
