import axios from "axios"
import mockData from "../input-data/data3.js";
export function getWholeData(sceneNameOrUrl) {
  // return Promise.resolve(mockData.data)
  let url = sceneNameOrUrl.startsWith('http') ?
    sceneNameOrUrl :
    `http://192.168.0.11:8080/laser/route/${sceneNameOrUrl}/getRouteInfo`

  return axios
    .get(url)
    .then((res) => {
      if (Array.isArray(res.data.data) && res.data.data.length > 0) {
        return res.data.data
      } else {
        throw('getWholeData结果异常！')
      }
    })
}