From e6876435fdba6f37df9846c9814f28bb5ebdf83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Mon, 26 Oct 2026 12:04:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(toast):=20=E5=85=BC=E5=AE=B9=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=AF=B9=E8=B1=A1=E5=8F=96=20msg=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E5=BC=B9=E5=87=BA=E7=A9=BA=E9=BB=91=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- frontend/uni-app/src/utils/util.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/uni-app/src/utils/util.js b/frontend/uni-app/src/utils/util.js index c184020a5..83f1ffd07 100644 --- a/frontend/uni-app/src/utils/util.js +++ b/frontend/uni-app/src/utils/util.js @@ -34,8 +34,13 @@ export default { to_url = opt; opt = {}; } - let title = opt.title || "", - icon = opt.icon || "none", + // 兼容接口/异常对象:非字符串时取 msg/message,避免 toast 出现空黑框 + let title = opt.title || ""; + if (title && typeof title !== "string") { + title = title.msg || title.message || ""; + } + title = title == null ? "" : String(title); + let icon = opt.icon || "none", endtime = opt.endtime || 2000, success = opt.success; if (title)