Quellcode durchsuchen

修改adflow、tacs接口

lichunyang vor 4 Monaten
Ursprung
Commit
dbcbcc23ff
2 geänderte Dateien mit 18 neuen und 36 gelöschten Zeilen
  1. 9 18
      src/views/titlecomponent/ADflow.vue
  2. 9 18
      src/views/titlecomponent/TACS.vue

+ 9 - 18
src/views/titlecomponent/ADflow.vue

@@ -810,24 +810,15 @@ const fetchCgnsData = async (fpid) =>{
 }
 const getCgnsData = async (fpid) =>{
   try {
-    const response = await fetch('https://www.adicn.com/airopt/TransServlet', {
-      method: 'POST',
-      headers: {
-        'Content-Type': 'application/json',
-      },
-      body: JSON.stringify({
-        channelNo: 'service',
-        clientToken: 'e47b87eec69545559d1e81e56626da68',
-        transCode: 'MDO0062',
-        userId: '5f06c8bc77234f969d13e160b54c27e3',
-        fid: fpid
-      }),
-    });
-    // 解析 JSON 数据
-  const data = await response.json(); //
-  console.log('接口返回的数据:', data); // 正确打印数据
-  cgnsData.value = data;
-  isLoading.value = false;
+    const params = {
+    transCode: "MDO0062",
+    fid: fpid
+    }
+    request(params).then((res) => {
+      const data = response.json();
+      cgnsData.value = data;
+      isLoading.value = false;
+    })
   }catch (error) {
     isLoading.value = false;
     console.error("请求失败:", error.response || error);

+ 9 - 18
src/views/titlecomponent/TACS.vue

@@ -627,24 +627,15 @@ const fetchBdfData = async (fpid) =>{
 }
 const getBdfData = async (fpid) =>{
   try {
-    const response = await fetch('https://www.adicn.com/airopt/TransServlet', {
-      method: 'POST',
-      headers: {
-        'Content-Type': 'application/json',
-      },
-      body: JSON.stringify({
-        channelNo: 'service',
-        clientToken: 'e47b87eec69545559d1e81e56626da68',
-        transCode: 'MDO0062',
-        userId: '5f06c8bc77234f969d13e160b54c27e3',
-        fid: fpid
-      }),
-    });
-    // 解析 JSON 数据
-  const data = await response.json(); //
-  console.log('接口返回的数据:', data); // 正确打印数据
-  bdfData.value = data;
-  isLoading.value = false;
+    const params = {
+    transCode: "MDO0062",
+    fid: fpid
+    }
+    request(params).then((res) => {
+      const data = res.json();
+      bdfData.value = data;
+      isLoading.value = false;
+    })
   }catch (error) {
     isLoading.value = false;
     console.error("请求失败:", error.response || error);