fix(util): 优化跳转参数的空值处理逻辑

将原有的可选链空合并赋值改为条件式展开参数,避免传入无效的空值参数
This commit is contained in:
2026-07-14 17:08:12 +08:00
parent b7cfa61a34
commit c1289cd6b1

View File

@@ -1452,8 +1452,8 @@ export default {
const { wap_url, name, parent, type, appid, page, mobile, image, ...navParams } = link;
this.redirectTo(link.wap_url, {
...navParams,
title: link?.title ?? '',
enable_set_title: link?.enable_set_title ? 1 : 0,
...(link.title != null && { title: link.title }),
...(link.enable_set_title != null && { enable_set_title: link.enable_set_title ? 1 : 0 }),
...(link.page_params || {})
});
}