import request from '@/common/system/request';

/**
 * 获取层级分配后的区域信息
 * @returns {Promise<any>}
 */
export const getAreas = async () => {
    const res = await request.post("Common/GetAreas");
    if (res.code == 0) {
        return res.data;
    }
    return null;
}

/**
 * 返回配置数据文件V2.0
 * @returns {Promise<any>}
 */
export const getConfig = async () => {
    const res = await request.get("Common/GetConfig");
    if (res.code == 0) {
        return res.data;
    }
    return null;
}

/**
 * 接口测试反馈
 * @returns {Promise<any>}
 */
export const interFaceTest = async () => {
    const res = await request.post("Common/h");
    if (res.code == 0) {
        return res.data;
    }
    return null;
}

/**
 * 获取服务与说明数据
 * @returns {Promise<any>}
 */
export const getServiceDescription = async () => {
    const res = await request.post("Common/GetServiceDescription");
    if (res.code == 0) {
        return res.data;
    }
    return null;
}

/**
 * 上传附件通用接口
 * @param {FormData} formData 上传的表单数据
 * @returns {Promise<any>}
 */
export const uploadImages = async (formData) => {
    const res = await request.post("Common/UploadImages", formData);
    if (res.code == 0) {
        return res.data;
    }
    return null;
} 