345
wangjuncheng
2 天以前 770dae03ffe931e4c2dfc1860b60c058cc5ed149
src/api/trApi.js
@@ -164,7 +164,7 @@
    const response = await fetch(url); // 发起请求  
    // console.log(url,'aaaaaaaaa')
    console.log(url,'aaaaaaaaa')
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
@@ -191,4 +191,18 @@
    throw error; // 抛出错误,让调用方可以捕获
  }
}
export async function getCrossSection(data) {
  // console.log(data,'发送的数据!');
  try {
    const res = await instance.get("/simu/crossSection", {
      params: data
    });
    return res.data; // 返回实际数据(通常 res.data 才是接口返回的内容)
  } catch (error) {
    console.error("Error fetching data:", error);
    throw error; // 抛出错误,让调用方可以捕获
  }
}
// **************************************************************************************************************