@peninsula-med/beisen-ehr-plugin 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/index.cjs.js +28 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +28 -10
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
### 方式一:一键安装(推荐)
|
|
8
8
|
|
|
9
|
+
```bash
|
|
10
|
+
# 安装插件(自动配置工具 allowlist)
|
|
11
|
+
openclaw plugins install @peninsula-med/beisen-ehr-plugin@latest
|
|
12
|
+
|
|
13
|
+
# 配置凭证(交互式输入)
|
|
14
|
+
npx @peninsula-med/beisen-ehr-configure
|
|
15
|
+
|
|
16
|
+
# 重启 Gateway
|
|
17
|
+
openclaw gateway restart
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
✅ 安装时会自动配置工具 allowlist,无需手动编辑配置文件!
|
|
21
|
+
|
|
9
22
|
```bash
|
|
10
23
|
# 1. 安装插件
|
|
11
24
|
openclaw plugins install @peninsula-med/beisen-ehr-plugin
|
package/dist/index.cjs.js
CHANGED
|
@@ -3461,7 +3461,7 @@ const Type = TypeBuilder;
|
|
|
3461
3461
|
*/
|
|
3462
3462
|
// 插件元数据
|
|
3463
3463
|
const pluginId = 'beisen-ehr-plugin';
|
|
3464
|
-
const pluginVersion = '1.1.
|
|
3464
|
+
const pluginVersion = '1.1.8';
|
|
3465
3465
|
/**
|
|
3466
3466
|
* 默认配置
|
|
3467
3467
|
*/
|
|
@@ -3514,18 +3514,36 @@ class BeisenClient {
|
|
|
3514
3514
|
...(this.config.tenantId && { "tenantId": this.config.tenantId }),
|
|
3515
3515
|
...(options.headers || {}),
|
|
3516
3516
|
};
|
|
3517
|
+
const requestBody = options.body ? JSON.stringify(options.body) : undefined;
|
|
3517
3518
|
console.error(`📡 请求:${options.method || 'GET'} ${url}`);
|
|
3519
|
+
console.error(`🔑 Token: ${token ? token.substring(0, 20) + '...' : 'none'}`);
|
|
3518
3520
|
console.error(`🏢 TenantId: ${this.config.tenantId}`);
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
const
|
|
3526
|
-
|
|
3521
|
+
if (requestBody) {
|
|
3522
|
+
console.error(`📦 请求体:${requestBody.substring(0, 200)}...`);
|
|
3523
|
+
}
|
|
3524
|
+
const controller = new AbortController();
|
|
3525
|
+
const timeoutId = setTimeout(() => controller.abort(), 30000); // 30 秒超时
|
|
3526
|
+
try {
|
|
3527
|
+
const response = await fetch(url, {
|
|
3528
|
+
...options,
|
|
3529
|
+
headers,
|
|
3530
|
+
body: requestBody,
|
|
3531
|
+
signal: controller.signal,
|
|
3532
|
+
});
|
|
3533
|
+
clearTimeout(timeoutId);
|
|
3534
|
+
if (!response.ok) {
|
|
3535
|
+
const errorText = await response.text();
|
|
3536
|
+
throw new Error(`北森 API 错误:${response.status} - ${errorText}`);
|
|
3537
|
+
}
|
|
3538
|
+
return response.json();
|
|
3539
|
+
}
|
|
3540
|
+
catch (error) {
|
|
3541
|
+
clearTimeout(timeoutId);
|
|
3542
|
+
if (error.name === 'AbortError') {
|
|
3543
|
+
throw new Error('北森 API 请求超时(30 秒)');
|
|
3544
|
+
}
|
|
3545
|
+
throw error;
|
|
3527
3546
|
}
|
|
3528
|
-
return response.json();
|
|
3529
3547
|
}
|
|
3530
3548
|
// 提交加班申请(推送至北森系统并发起审批)
|
|
3531
3549
|
async submitOvertime(data) {
|