← 返回 Skills 市场
泛微 e-office v11 协同办公系统 OpenAPI
作者
quanruxiaohong
· GitHub ↗
· v1.0.1
· MIT-0
157
总下载
1
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install eoffice-api
功能描述
泛微 e-office 协同办公系统 OpenAPI - 用户管理、部门管理、审批流程、考勤等企业级 API
使用说明 (SKILL.md)
e-office10 OpenAPI Skill
当用户提到以下场景时使用此 skill:
- 查询/搜索企业内部用户信息
- 新建/编辑/删除用户账号
- 查询部门组织架构
- 发起或审批工作流程
- 查询考勤记录
- 发送内部通知消息
- 管理客户或合同信息
- 任何需要操作 OA 系统的任务
认证方式
本 skill 使用自定义 token 流程,与 OAuth2 类似但更简单:
首次使用步骤
-
获取 Token(调用
scripts/get-token.py)python scripts/get-token.py这会向 OA 系统发送请求,用环境变量中的
EOFFICE_AGENT_ID、EOFFICE_SECRET、EOFFICE_USER换取访问 token。 -
Token 自动管理
- Agent 会自动缓存 token
- Token 过期时自动重新获取
- 无需手动管理
环境配置
安装 skill 后,用户需要提供以下环境变量(在 OpenClaw 配置中设置):
| 环境变量 | 必填 | 说明 | 示例 |
|---|---|---|---|
EOFFICE_BASE_URL |
是 | OA 系统部署地址 | https://oa.example.com/server |
EOFFICE_AGENT_ID |
是 | 应用 Agent ID | 100001 |
EOFFICE_SECRET |
是 | 应用密钥 | abc123def456... |
EOFFICE_USER |
是 | 用户标识(工号/账号/手机号) | admin 或 18612345678 |
如何获取凭证:
- 登录 OA 系统管理后台
- 进入「集成中心」→「OpenAPI」
- 创建应用,获取
Agent ID和Secret - 配置用户识别字段(工号/账号/手机号)
- 将用户账号填入
EOFFICE_USER
使用方法
用户管理
查询用户列表
curl -X GET "$EOFFICE_BASE_URL/api/hrm/lists" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"page": 1, "limit": 10}'
查询单个用户详情
curl -X GET "$EOFFICE_BASE_URL/api/hrm/detail/{user_id}" \
-H "Authorization: Bearer {token}"
新建用户
curl -X POST "$EOFFICE_BASE_URL/api/hrm/add" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"user_accounts": "zhangsan",
"user_name": "张三",
"dept_id": 1,
"role_id": [1, 2],
"user_status": 1,
"allow_login": 1,
"wap_allow": 1,
"sex": 1
}'
编辑用户
curl -X POST "$EOFFICE_BASE_URL/api/hrm/edit" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"user_id": "WV00000001",
"user_accounts": "zhangsan",
"user_name": "张三(已修改)",
"dept_id": 2,
"role_id": [1],
"user_status": 1,
"allow_login": 1,
"wap_allow": 1,
"sex": 1
}'
删除用户
curl -X POST "$EOFFICE_BASE_URL/api/hrm/delete/{user_id}" \
-H "Authorization: Bearer {token}"
部门管理
获取部门列表(树形)
curl -X GET "$EOFFICE_BASE_URL/api/department/allTree" \
-H "Authorization: Bearer {token}"
获取部门详情
curl -X GET "$EOFFICE_BASE_URL/api/department/detail/{dept_id}" \
-H "Authorization: Bearer {token}"
常用查询示例
搜索用户(按姓名模糊搜索)
GET /api/hrm/lists
Body: {"search": {"user_name": ["张", "like"]}}
获取用户在某个部门的用户列表
GET /api/department/users/{dept_id}
获取用户的上级领导
GET /api/hrm/superior/{user_id}
获取用户的下级下属
GET /api/hrm/subordinate/{user_id}
响应格式
所有 API 返回格式统一:
成功:
{
"status": 1,
"data": { ... }
}
失败:
{
"status": 0,
"errors": [
{"code": "0x000003", "message": "未知错误"}
]
}
错误码
| 错误码 | 说明 |
|---|---|
0x000003 |
未知错误 |
0x500001 |
参数缺失 |
0x500002 |
应用不存在 |
0x500003 |
Token 无效或已过期 |
0x500004 |
语言环境无效 |
0x500005 |
用户不存在 |
0x500006 |
用户不在白名单内 |
0x500007 |
无账号人员不支持生成 Token |
注意事项
- 敏感操作:删除用户等敏感操作需要管理员权限
- 用户状态:
user_status字段标识用户是否在职,离职用户通常user_status为特定值 - 部门 ID:新建用户需要指定
dept_id,可先调用部门列表 API 查询 - 角色 ID:
role_id是数组,指定用户的权限角色 - Token 有效期:默认 Token 有效期由 OA 系统配置,通常为数小时
完整 API 文档
详见 references/api.md
安全使用建议
This skill appears to do what it says: it needs your e-office Base URL, Agent ID, Secret, and a user identifier to obtain tokens and call OA APIs. Before installing: (1) verify the skill's source/maintainer — the repository homepage is a placeholder (https://github.com/yourname) and the package owner is unknown; prefer an official or audited source; (2) ensure EOFFICE_BASE_URL points to your trusted OA instance (do not point it at a third-party server you don't control); (3) treat EOFFICE_SECRET as sensitive — use least-privilege application credentials and consider creating an app scoped only to required operations; (4) be aware get-token.py prints tokens to stdout (which could be captured in logs/transcripts) — confirm your agent/platform handles secrets and logs securely; (5) confirm whether your OpenClaw agent runtime provides secure token caching/refresh — SKILL.md claims automatic caching but the repo provides only a helper script, not persistent storage. If any of the above concerns are unacceptable, review or host the code yourself and test the script locally before enabling the skill in production.
功能分析
Type: OpenClaw Skill
Name: eoffice-api
Version: 1.0.1
The eoffice-api skill is a legitimate integration for the Weaver e-office (泛微) OA system, providing tools for user and department management. The included Python script (scripts/get-token.py) correctly implements the standard OpenAPI authentication flow using environment variables, and the documentation (SKILL.md, references/api.md) accurately reflects the official API structure without any signs of malicious intent, data exfiltration, or prompt injection.
能力评估
Purpose & Capability
Name/description, declared env vars (EOFFICE_BASE_URL, EOFFICE_AGENT_ID, EOFFICE_SECRET, EOFFICE_USER), example curl commands and the included get-token.py script all align with a client for e-office OpenAPI. No unrelated cloud credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md instructs the agent to call scripts/get-token.py to obtain a token and then call the documented OA endpoints. The README and script only perform HTTP requests to the provided EOFFICE_BASE_URL. Two items to note: (1) SKILL.md states the agent "will automatically cache token / refresh when expired" — the repository contains a refresh helper but no persistent cache implementation, so caching is an agent/platform responsibility (possible minor mismatch between claim and provided code); (2) the get-token.py prints the token to stdout, which may expose tokens in logs or agent transcripts if not handled carefully.
Install Mechanism
No install spec is provided (instruction-only skill with a small helper script). The only runtime dependency is Python + requests (not unusual). There are no downloads from arbitrary URLs or archive extraction steps. Risk from install mechanism is low.
Credentials
Required env vars (base URL, agent id, secret, user) are appropriate for the described OpenAPI. The get-token.py script also optionally reads EOFFICE_TOKEN and EOFFICE_REFRESH_TOKEN for refresh flow; those are not listed as required in SKILL.md but are optional and reasonable. All requested variables are OA-specific and proportionate — no unrelated secrets are requested.
Persistence & Privilege
Skill does not request always:true and does not ask to modify other skills or system settings. It claims token caching and automatic refresh, which is normal for API client behavior; persistent storage of tokens would be handled by the agent/runtime, not the skill files themselves.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install eoffice-api - 安装完成后,直接呼叫该 Skill 的名称或使用
/eoffice-api触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- README 中添加了 OA 开放平台应用管理的外部说明链接
- 其余内容无变更(SKILL.md 未修改)
v1.0.0
Initial release of the eoffice-api skill.
- Provides OpenAPI access to 泛微 e-office for user management, department management, workflows, attendance, and notifications.
- Includes details for environment variable configuration and authentication token management.
- Describes common API endpoints for creating, editing, querying, and deleting users and departments.
- Lists standard response formats and error codes for API integration.
- Offers usage examples and guidance for typical operations within OA systems.
元数据
常见问题
泛微 e-office v11 协同办公系统 OpenAPI 是什么?
泛微 e-office 协同办公系统 OpenAPI - 用户管理、部门管理、审批流程、考勤等企业级 API. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 157 次。
如何安装 泛微 e-office v11 协同办公系统 OpenAPI?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install eoffice-api」即可一键安装,无需额外配置。
泛微 e-office v11 协同办公系统 OpenAPI 是免费的吗?
是的,泛微 e-office v11 协同办公系统 OpenAPI 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
泛微 e-office v11 协同办公系统 OpenAPI 支持哪些平台?
泛微 e-office v11 协同办公系统 OpenAPI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 泛微 e-office v11 协同办公系统 OpenAPI?
由 quanruxiaohong(@quanruxiaohong)开发并维护,当前版本 v1.0.1。
推荐 Skills