import ajax from './ajax'
import {LOCATION_URL} from "@/config/config";

// 1. 定义基础路径
const BASE_URL = LOCATION_URL
// const BASE_URL = '/huiqicha'
// const BASE_URL = 'https://lhlas-dev.zrubft.com'
// const BASE_URL = 'http://158.226.90.148:10022'
// const BASE_URL = 'http://158.234.145.74:8099'

// 查询关注信息
export const postAttentionInfo = (params) => ajax(BASE_URL + `/huiqicha/mobile/attention/queryMobileAttentionInfos`, params, 'POST');

// 根据登录用户查询分组信息
export const postQueryByLoginUser = () => ajax(BASE_URL + `/huiqicha/mobile/attention/queryByLoginUser`, {}, 'POST');

// 根据名称查询分组信息
export const postQueryByName = (params) => ajax(BASE_URL + `/huiqicha/mobile/attention/queryByName`, params, 'POST');

// 添加分组

export const postAddGroupInfo = (params) => ajax(BASE_URL + `/huiqicha/mobile/attention/addGroupInfo`, params, 'POST');

// 批量删除分组
export const postDeleteGroupInfo = (params) => ajax(BASE_URL + `/huiqicha/mobile/attention/batchDeleteGroupInfo`, params, 'POST');

// 重命名分组
export const postUpdateGroupInfo = (params) => ajax(BASE_URL + `/huiqicha/mobile/attention/updateGroupInfo`, params, 'POST');

// 批量取消关注
export const postBatchDelateAttention = (params) => ajax(BASE_URL + `/huiqicha/mobile/attention/batchDelateAttention`, params, 'POST');

// 移动分组
export const postUpdateAttentionCompany = (params) => ajax(BASE_URL + `/huiqicha/mobile/attention/updateAttentionCompany`, params, 'POST');

// 批量移动分组
export const postBatchUpdateAttention = (params) => ajax(BASE_URL + `/huiqicha/mobile/attention/batchUpdateAttention`, params, 'POST');

// 添加关注
export const postAddAttentionCompany = (params) => ajax(BASE_URL + `/huiqicha/mobile/attention/addAttentionCompany`, params, 'POST');

// 查工商变更
export const postCompanyChangePage = (params) => ajax(BASE_URL + `/huiqicha/mobile/monitor/queryMonitorCompanyChangePage`, params, 'POST');

// 查舆情信息
export const postMonitorNewsPage = (params) => ajax(BASE_URL + `/huiqicha/mobile/monitor/queryMonitorNewsPage`, params, 'POST');

// 查失信信息
export const postMonitorShixinPage = (params) => ajax(BASE_URL + `/huiqicha/mobile/monitor/queryMonitorShixinPage`, params, 'POST');

// 查被执行人信息
export const postMonitorZhixingPage = (params) => ajax(BASE_URL + `/huiqicha/mobile/monitor/queryMonitorZhixingPage`, params, 'POST');

// 查裁判文书信息
export const postMonitorJudgementPage = (params) => ajax(BASE_URL + `/huiqicha/mobile/monitor/queryMonitorJudgementPage`, params, 'POST');

// 查法院公告信息
export const postMonitorCourtPage = (params) => ajax(BASE_URL + `/huiqicha/mobile/monitor/queryMonitorCourtPage`, params, 'POST');

// 查限制高消费信息
export const postMonitorLimitHighconsumePage = (params) => ajax(BASE_URL + `/huiqicha/mobile/monitor/queryMonitorLimitHighconsumePage`, params, 'POST');

// 查行政许可信息
export const postMonitorCreditChinaLicensePage = (params) => ajax(BASE_URL + `/huiqicha/mobile/monitor/queryMonitorCreditChinaLicensePage`, params, 'POST');

// 查招投标信息
export const postMonitorBiddingBaseinfoPage = (params) => ajax(BASE_URL + `/huiqicha/mobile/monitor/queryMonitorCompanyBiddingBaseinfoPage`, params, 'POST');

// 查进出口信息
export const postMonitorImportExportDetailPage = (params) => ajax(BASE_URL + `/huiqicha/mobile/monitor/queryMonitorImportExportDetailPage`, params, 'POST');

// 查融资信息
export const postMonitorFinancingPage = (params) => ajax(BASE_URL + `/huiqicha/mobile/monitor/queryMonitorFinancingPage`, params, 'POST');

// 查询关注信息
export const getUserInfo = (code) => ajax(BASE_URL + `/huiqicha/mobile/qy/weixin/userinfo?code=${code}`, {}, 'GET');


// 取消关注信息
export const postCancelGuanzhu = (params) => ajax(BASE_URL + `/huiqicha/mobile/attention/deleteByCompanyId`, params, 'POST');



// const LOCAL_BASE_URL = "http://localhost:3000/web/xlmc"
const LOCAL_BASE_URL = "/api"

// 5.1 获取短信验证码(GET)
export const getPhoneCode = (phone) => ajax(LOCAL_BASE_URL + '/api/send_code', {phone});

// 5.2 手机验证码登录(POST)
export const phoneCodeLogin = (phone, code) => ajax(LOCAL_BASE_URL + '/api/login_code', {phone, code}, 'POST');
