From fc5779225e597557570afb921bedcd7a1223be67 Mon Sep 17 00:00:00 2001 From: dubai Date: Thu, 12 Feb 2026 01:01:13 +0800 Subject: [PATCH] =?UTF-8?q?docs(readme):=20=E6=9B=B4=E6=96=B0=20API=20?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E9=A3=8E=E6=A0=BC=E5=85=BC=E5=AE=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.Vben5.Vue3/README.md | 45 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/Yi.Vben5.Vue3/README.md b/Yi.Vben5.Vue3/README.md index 0ddad66e..5c32b30a 100644 --- a/Yi.Vben5.Vue3/README.md +++ b/Yi.Vben5.Vue3/README.md @@ -18,8 +18,51 @@ 该仓库使用vben5开发,采用分包目录结构, 具体开发路径为: `根目录/apps/web-antd` -**后端需要开启”furion格式的规范化api“**:路径在Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs +前端已同时兼容 **Furion 规范化 API 响应** 和 **ABP 风格响应**,可通过 `apps/web-antd/.env` 中的 `VITE_GLOB_API_STYLE` 配置响应风格:`auto`(默认)、`furion`、`abp`。 +如果使用 Furion 规范化响应,可在 `Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs` 中开启相关配置。 + +**Furion风格示例** + +````json +{ + "statusCode": 200, + "data": {"name": "大橙子","age": 20}, + "succeeded": true, + "errors": null, + "extras": null, + "timestamp": 1770825190 +} +```` +**ABP风格示例** + +````json +// 成功响应 +{ "name": "大橙子","age": 20} +```` +````json +// 异常响应 +{ + "error": { + "code": "string", + "message": "string", + "details": "string", + "data": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "validationErrors": [ + { + "message": "string", + "members": [ + "string" + ] + } + ] + } +} +````