fix(toast): 兼容异常对象取 msg,避免弹出空黑框

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
吴昊天 2026-10-26 12:04:40 +08:00
parent b6367d82d9
commit e6876435fd

View File

@ -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)