import {  myFetch, download, commonUpload } from "../utils/fetch";
import { httpApi } from "@/common/js/baseUrl";
import zlbApi from "@/api/zlbApi";
// 字典查询接口 '/system/getDictionaryByName'
export function getDictionaryByName(data) {
  const url = zlbApi.getDictionaryByName; // '/system/getDictionaryByName'
  return myFetch(url, "get", data, "json");
}

// 批量查询字典内容 '/system/getDicByNameList'
export function getDicByNameList(data) {
  const url = zlbApi.getDicByNameList; // '/system/getDicByNameList'
  return myFetch(url, "get", data, "json");
}

// 查询地区 '/system/listArea'
export function listArea(data) {
  const url = zlbApi.listArea; // '/system/listArea'
  return myFetch(url, "get", data, "json");
}

// 上传文件 '/file/upload'
export function uploadFile(config = { tempFilePath: "", fileBase64Vos: '', catalog: '' }) {
  console.log("上传文件配置", config);
  const url = zlbApi.uploadBase64; // '/file/upload'
  return myFetch(url, "post", config, "json");
}

// 下载文件 '/file/download?fileUuid'
export function downloadFile(data) {
  const url = zlbApi.fileDownload; // '/file/download?fileUuid'
  return download(url, "get", data);
}

/**
 * 浙政钉 获取用户信息
 * /system/ZzdLogin
 */
export function ZzdLogin(data) {
  const url = zlbApi.ZzdLogin;
    return myFetch(url, "post", data, "json");
}

/**
 * 浙政钉 获取用户信息
 * /system/exemption
 */
export function exemption(data) {
  const url = zlbApi.exemption;
  return myFetch(url, "post", data, "json");
}

/**
 * 获取村社链接
 * /business/address/getVillageLink
 */
export const getVillageLink=(data)=>{
  const url = zlbApi.getVillageLink
  return myFetch(url, 'get', data, 'json');
}