1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| // src/api/api.ts
|
| import axios from 'axios';
|
| interface SetTimeoutAlertRequest {
| deviceCode: string;
| minutes: number;
| alertText: string;
| }
|
| interface ApiResponse {
| code: number;
| data: string;
| message: string;
| }
|
| const apiBaseUrl = 'https://backend.ihemodialysis.com'; // 替换为你的API基础URL
|
| export const setTimeoutAlert = async (requestData: SetTimeoutAlertRequest): Promise<ApiResponse> => {
| try {
| const response = await axios.post(`${apiBaseUrl}/patient/hemo/med/record/setTimeoutAlert`, requestData, {
| headers: {
| 'Content-Type': 'application/x-www-form-urlencoded'
| }
| });
| return response.data;
| } catch (error) {
| console.error('Error setting timeout alert:', error);
| throw error;
| }
| };
|
|