From 2191b6011fdab3b76344fc2447b8b6aaa972b6c1 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期四, 07 八月 2025 15:48:09 +0800
Subject: [PATCH] 加入完整日志
---
src/samples/httpApi.ts | 2 +-
src/utils/axios.ts | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/samples/httpApi.ts b/src/samples/httpApi.ts
index 29f06ee..bfdd669 100644
--- a/src/samples/httpApi.ts
+++ b/src/samples/httpApi.ts
@@ -16,7 +16,7 @@
queryCode:codeStr
}
getPatientInfo2(mode).then(re=>{
- ipcRenderer.invoke('logger', `获取患者数据成功:${JSON.stringify(re.data)}`)
+ ipcRenderer.invoke('logger', `获取患者数据成功:${JSON.stringify(re)}`)
writePatient(re.data)
}).catch(err=>{
ipcRenderer.invoke('logger', `获取患者数据失败:${err}`)
diff --git a/src/utils/axios.ts b/src/utils/axios.ts
index a4ded42..3771f0b 100644
--- a/src/utils/axios.ts
+++ b/src/utils/axios.ts
@@ -1,10 +1,10 @@
import axios, {AxiosError, AxiosResponse} from 'axios'
import { Session } from '@/utils/storage'
import { ElMessage } from 'element-plus'
-import { confingInfoStore } from '@/stores/StoresConfing'
+import { ipcRenderer } from 'electron'
-let BASE_URL = 'http://testbs.ihemodialysis.com'
-// let BASE_URL = 'https://hemobs.icoldchain.cn'
+
+let BASE_URL = 'https://hemobs.icoldchain.cn'
const TIME_OUT = 10 * 1000
// setTimeout(()=>{
@@ -42,6 +42,7 @@
if (Session.get('token')) {
response.headers.common['Authorization'] = 'Bearer '+ `${Session.get('token')}`
}
+ ipcRenderer.invoke('logger', `http请求参数:${JSON.stringify(response)}`)
return response
},
(error) => Promise.reject(error)
@@ -50,6 +51,7 @@
// 后置拦截器(获取到响应时的拦截)
instance.interceptors.response.use(
(res: AxiosResponse) => {
+ ipcRenderer.invoke('logger', `http响应参数:${JSON.stringify(res)}`)
if (String(res.status).indexOf('2') !== 0) {
return {
code: res.status,
--
Gitblit v1.8.0