From e43e598f0d0d36855b7c5f2518f62d3d406a8aec Mon Sep 17 00:00:00 2001
From: zhangchen <1652267879@qq.com>
Date: 星期二, 09 九月 2025 16:47:12 +0800
Subject: [PATCH] Merge branch 'master' of http://dh.leon056.com:7499/r/data2/Single_application into ID1766-添加推送登录功能
---
src/utils/httpApi.ts | 69 +++++++++++++++++++++++++++++++++-
1 files changed, 67 insertions(+), 2 deletions(-)
diff --git a/src/utils/httpApi.ts b/src/utils/httpApi.ts
index e35467c..d8f0c2e 100644
--- a/src/utils/httpApi.ts
+++ b/src/utils/httpApi.ts
@@ -14,7 +14,9 @@
message: string;
}
-const apiBaseUrl = 'https://backend.ihemodialysis.com'; // 替换为你的API基础URL
+// const apiBaseUrl = 'https://backend.ihemodialysis.com'; // 替换为你的API基础URL
+// const apiBaseUrl = 'https://testbs.ihemodialysis.com'; // 替换为你的API基础URL
+const apiBaseUrl = import.meta.env.VITE_API_BASE_URL;
export const setTimeoutAlert = async (requestData: SetTimeoutAlertRequest): Promise<ApiResponse> => {
try {
@@ -28,4 +30,67 @@
console.error('Error setting timeout alert:', error);
throw error;
}
-};
\ No newline at end of file
+};
+
+export const sendValidateCode = async (requestData): Promise<ApiResponse> => {
+ try {
+ const response = await axios.post(`${apiBaseUrl}/user/info/sendValidateCodeForRegister`, requestData, {
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ }
+ });
+ return response.data;
+ } catch (error) {
+ console.error('Error setting timeout alert:', error);
+ throw error;
+ }
+};
+
+export const registerForNutrition = async (requestData): Promise<ApiResponse> => {
+ try {
+ const response = await axios.post(`${apiBaseUrl}/user/info/registerForNutrition`, requestData, {
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ });
+ return response.data;
+ } catch (error) {
+ console.error('Error setting timeout alert:', error);
+ throw error;
+ }
+};
+
+/**
+ * 停止定时任务
+ * @param deviceCode
+ * @returns
+ */
+export const stopTimeoutAlert = async (deviceCode: string) => {
+ try {
+ const response = await axios.post(`${apiBaseUrl}/patient/hemo/med/record/stopTimeoutAlert`, { deviceCode }, {
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ }
+ });
+ return response.data;
+ } catch (error) {
+ throw error;
+ }
+}
+
+/**
+ * 获取副屏最新的版本号Api
+ * @returns
+ */
+export const getServiceVersionApi = async(version: string) => {
+ try {
+ const response = await axios.post(`${apiBaseUrl}/system/version/subscreen/showVersionDiff`, { version }, {
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ }
+ });
+ return response.data;
+ } catch (error) {
+ throw error;
+ }
+}
\ No newline at end of file
--
Gitblit v1.8.0