/*
 * @Author: tengmingxue 1473375109@qq.com
 * @Date: 2023-08-15 11:20:48
 * @LastEditors: tengmingxue 1473375109@qq.com
 * @LastEditTime: 2023-08-21 17:19:02
 * @FilePath: \xld-gis-admin\src\api\resource\scene.ts
 * @Description: 场景资源接口
 */
import { defHttp } from '/@/utils/http/axios';
import { session } from "/@/utils/Memory.js";
enum Api {
    Login = '/callProvider'
}
const interfaceType = { apiUrl2: true };

/**
 * @description:获取地图资源列表
 */
export function list() {
    const formData = new FormData();
    formData.append("interfaceName", "antu.space.provider.sservicebase.ServiceBaseMetaDataViewProvider");
    formData.append("methodName", "getResourcePagedList");
    formData.append("args[]", session.getItem('tokenV2'));
    formData.append("args[]", `{"type":"ER","pageIndex":1,"pageSize":20,"orderBy":"updatedate DESC"}`);
    // formData.append("args[]", `{"type":"ER","pageIndex":1,"userid": "${session.getItem('userId')}","pageSize":20,"orderBy":"updatedate DESC"}`);
    return new Promise<void>((resolve, reject) => {
        defHttp.post({ url: Api.Login, params: formData, ...interfaceType })
            .then((r) => {
                let result = r.result === '' ? {} : JSON.parse(r.result)
                console.log('场景资源数据', result)
                resolve(result);
            })
    })
}


