import axios from "axios" import generalData from "@/assets/mock/general.json" // axios({ // method: 'post', // url: `${config.backendDir}visit/saveType`, // headers: { // appId: "CA02F83A5FA162B930AA2F962D202F43B0F6DE0B51AD79FEDB03FA8202BB4909330105B3B347510D87C97060C4288280D4A744E00565A4EC", // "Content-Type": "application/json", // }, // data: { // moduleType, // type: 'visit', // }, // }) export default { // getGeneralList() { // const listKeyNameCorrected = generalData.data.map((item) => { // const ret = { // id: item.id, // name: item.name, // createDay: item.createTime, // description: item.content, // } // return ret // }) // listKeyNameCorrected.sort((a, b) => { // return Date.parse(a.createDay.substring(0, 4)) - Date.parse(b.createDay.substring(0, 4)) // }) // return Promise.resolve(listKeyNameCorrected) // }, getSiteInfo() { return axios({ method: 'get', url: `${process.env.VUE_APP_API_ORIGIN}/api/show/site/getInfo`, headers: { "Content-Type": "application/json", }, }).then((res) => { return JSON.parse(res.data.data) }) }, getGeneralList({ endTime = '', pageNum = 0, pageSize = 10000, searchKey = '', startTime = '', } = {}) { return axios({ method: 'post', url: `${process.env.VUE_APP_API_ORIGIN}/api/show/company/pageList`, headers: { "Content-Type": "application/json", }, data: { endTime, pageNum, pageSize, searchKey, startTime, }, }).then((res) => { return res.data.data.records }) }, getGeneralDetail(id) { return axios({ method: 'get', url: `${process.env.VUE_APP_API_ORIGIN}/api/show/company/detail/${id}`, headers: { "Content-Type": "application/json", }, }).then((res) => { return res.data.data }) }, getHistoryList({ pageNum = 0, pageSize = 10000, searchKey = '', stage = '', } = {}) { return axios({ method: 'post', url: `${process.env.VUE_APP_API_ORIGIN}/api/show/history/pageList`, headers: { "Content-Type": "application/json", }, data: { pageNum, pageSize, searchKey, stage, }, }).then((res) => { return res.data.data.records }) }, getHistoryDetail(id) { return axios({ method: 'get', url: `${process.env.VUE_APP_API_ORIGIN}/api/show/history/detail/${id}`, headers: { "Content-Type": "application/json", }, }).then((res) => { return res.data.data }) }, getTreasureList({ pageNum = 0, pageSize = 10000, searchKey = '', stage = '', } = {}) { return axios({ method: 'post', url: `${process.env.VUE_APP_API_ORIGIN}/api/show/goods/pageList`, headers: { "Content-Type": "application/json", }, data: { pageNum, pageSize, searchKey, stage, } }).then((res) => { return res.data.data.records }) }, getTreasureDetail(id) { return axios({ method: 'get', url: `${process.env.VUE_APP_API_ORIGIN}/api/show/goods/detail/${id}`, headers: { "Content-Type": "application/json", }, data: {} }).then((res) => { return res.data.data }) }, reportTreasureVisit(id) { return axios({ method: 'get', url: `${process.env.VUE_APP_API_ORIGIN}/api/show/goods/addVisit/${id}`, headers: { "Content-Type": "application/json", }, data: {} }).then((res) => { }) }, getMetaverseList({ endTime = "", pageNum = 0, pageSize = 10000, searchKey = "", startTime = "", } = {}) { return axios({ method: 'post', url: `${process.env.VUE_APP_API_ORIGIN}/api/show/meta/pageList`, headers: { "Content-Type": "application/json", }, data: { endTime, pageNum, pageSize, searchKey, startTime, } }).then((res) => { return res.data.data.records }) }, // 获取元宇宙详情 getG4InfoApi(id) { return axios({ method: 'get', url: `${process.env.VUE_APP_API_ORIGIN}/api/show/meta/detail/${id}`, headers: { "Content-Type": "application/json", }, data: {} }).then((res) => { return res.data.data }) }, }