瀏覽代碼

Update files: src/api/deviceApi.js

D8D AI 1 年之前
父節點
當前提交
90f235a5ed
共有 1 個文件被更改,包括 4 次插入30 次删除
  1. 4 30
      src/api/deviceApi.js

+ 4 - 30
src/api/deviceApi.js

@@ -3,29 +3,13 @@ import axios from 'axios';
 const API_BASE_URL = 'http://your-device-api-url.com'; // 替换为实际的设备 API URL
 
 export const deviceApi = {
-  getDeviceInfo: async () => {
-    try {
-      const response = await axios.get(`${API_BASE_URL}/GetDeviceInfo`);
-      return response.data;
-    } catch (error) {
-      console.error('获取设备信息失败:', error);
-      throw error;
-    }
-  },
-
-  getAllPersons: async () => {
-    try {
-      const response = await axios.get(`${API_BASE_URL}/GetAllPersons`);
-      return response.data;
-    } catch (error) {
-      console.error('获取所有会友信息失败:', error);
-      throw error;
-    }
-  },
+  // 其他方法保持不变...
 
   addPerson: async (personInfo) => {
     try {
+      console.log('Sending request to add person:', personInfo); // 调试日志
       const response = await axios.post(`${API_BASE_URL}/AddPerson`, personInfo);
+      console.log('Response from add person:', response.data); // 调试日志
       return response.data;
     } catch (error) {
       console.error('添加会友失败:', error);
@@ -33,15 +17,5 @@ export const deviceApi = {
     }
   },
 
-  getAttendanceRecords: async (startTime, endTime) => {
-    try {
-      const response = await axios.get(`${API_BASE_URL}/GetAttendanceRecords`, {
-        params: { startTime, endTime }
-      });
-      return response.data;
-    } catch (error) {
-      console.error('获取考勤记录失败:', error);
-      throw error;
-    }
-  }
+  // 其他方法保持不变...
 };