Anyon e634118a22 refactor(plugin): 迁移 v8 插件化组件体系
将 v6 中直接放在本地 app 的后台与微信能力迁移为 v8 插件组件,并把运行时基础能力沉淀到独立插件包。

主要内容:

- 新增 think-library、system、worker、static、install 等基础插件包。

- 新增 account、payment、wechat-client、wechat-service、wemall、wuma 等业务插件包。

- 移除 v6 的 app/admin 与 app/wechat 本地应用实现,改由插件分发接管。

- 将 Helper 能力彻底并入 System,统一为 plugin\system\helper\* 命名空间。

- 同步插件迁移发布清单与根 route 占位,保证安装发布流程可复现。
2026-05-08 15:30:46 +08:00

79 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 防伪溯源接口
## 接口标准
- HTTP 入口:`/api/wuma/{controller}/{action}`
- 请求头要求:
```jsonc
{
"Authorization": "Bearer <JWT>", // 可选,登录后接口可能回传或续签令牌
"X-Device-Code": "DEVICE001", // 设备编号,必填
"X-Device-Type": "scanner" // 设备类型,必填
}
```
- 请求体要求:
```jsonc
{
"time": 1710000000000, // 请求时间戳,毫秒
"type": "json", // 请求体类型,支持 `json` 或 `aes`
"body": "{}" // 业务 JSON 字符串;`aes` 模式下为加密后的字符串
}
```
- 返回格式:
```jsonc
{
"code": 200, // 业务状态码
"info": "ok", // 提示信息
"data": {}, // 业务数据
"error": "", // 可选401/403 等鉴权异常时返回稳定错误标识
"token": "jwt" // 令牌续签时返回,可选
}
```
- HTTP 状态码固定返回 `200`
- `code` 统一使用常见业务状态语义:`200` 成功、`401` 未认证/登录过期、`403` 已认证但无权限、`404` 资源不存在、`500` 服务端异常
## 接口列表
### `/api/wuma/login/login`
- 说明:设备登录
```jsonc
{
"username": "device-user", // 登录用户名
"password": "******" // 登录密码
}
```
### `/api/wuma/login/logout`
- 说明:设备退出登录
```jsonc
{}
```
### `/api/wuma/coder/batch`
- 说明:查询物码批次
```jsonc
{
"batch": "BATCH001", // 批次编号
"token": "device-token" // 当前设备令牌
}
```
### `/api/wuma/coder/query`
- 说明:查询物码标签
```jsonc
{
"code": "TRACE_CODE", // 防伪码或物码编号
"token": "device-token", // 当前设备令牌
"type": "query" // 查询类型或业务模式
}
```