From c825c5bf6e13524145edca0bc4b4fcbb5a4fd6e0 Mon Sep 17 00:00:00 2001 From: lizw-2015 <1183409807@qq.com> Date: Mon, 30 Jun 2025 13:27:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(components):=20=E6=B7=BB=E5=8A=A0=20Er?= =?UTF-8?q?rorDialog=20=E7=BB=84=E4=BB=B6=E5=B9=B6=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=B8=9A=E5=8A=A1=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 ErrorDialog 组件,用于在对话框中展示错误信息 - 在 config.ts 中集成 ErrorDialog,用于处理业务异常 - 优化了异常处理逻辑,增加了错误详情的展示功能 --- src/components/ErrorDialog.vue | 90 ++++++++++++++++++++++++++++++++++++++++++ src/config.ts | 16 +++++++- 2 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 src/components/ErrorDialog.vue diff --git a/src/components/ErrorDialog.vue b/src/components/ErrorDialog.vue new file mode 100644 index 0000000..fb0568f --- /dev/null +++ b/src/components/ErrorDialog.vue @@ -0,0 +1,90 @@ + + + + + + + diff --git a/src/config.ts b/src/config.ts index 0c8fb1e..6d3d16b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -2,6 +2,8 @@ import type { InternalAxiosRequestConfig } from "axios"; import { Constant, initGlobalConfig } from "@ease-forge/shared"; import { initGlobalConfigWithRuntime } from "@ease-forge/runtime"; import router from "@/router"; +import { createVNode } from "vue"; +import ErrorDialog from "@/components/ErrorDialog.vue"; function globalConfig() { window.globalConfig.customAxios = axiosInstance => { @@ -30,6 +32,7 @@ function globalConfig() { status: response?.status ?? -1, title: "系统错误", message: "", + data: response?.data, }; if (!error || !response) { err.message = "请求服务端异常"; @@ -46,7 +49,18 @@ function globalConfig() { err.message = message ?? Constant.defHttpErrorMsg[response.status] ?? "服务器异常"; } } - system.msg(err.message); + system.showDialog(createVNode(ErrorDialog, { + err, + }), { + title: '业务异常', + width: 800, + height: 120, + showClose: true, + showMax: false, + showCancelButton: false, + showOkButton: true, + okButtonText: "关闭", + }).finally(); return Promise.reject(err); }, ); From 50898fe04e7d031db12a76942c7c251aa026188d Mon Sep 17 00:00:00 2001 From: lizw-2015 <1183409807@qq.com> Date: Mon, 30 Jun 2025 14:04:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(user):=20=E6=96=B0=E5=A2=9E=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加角色查询、新增、编辑和删除功能 - 实现角色信息的分页查询和动态加载 - 优化用户界面,增加角色管理相关按钮和对话框 - 新增角色请求模型类 --- src/views/user/roles.vue | 127 ++++++++++++++++++++++++++++++++++++++++++++--- src/views/user/users.vue | 4 +- 2 files changed, 122 insertions(+), 9 deletions(-) diff --git a/src/views/user/roles.vue b/src/views/user/roles.vue index f592f69..63e2baa 100644 --- a/src/views/user/roles.vue +++ b/src/views/user/roles.vue @@ -1,13 +1,14 @@