feat(lark-msg): genCard支持给value字段注入公共变量
All checks were successful
/ release (push) Successful in 23s

This commit is contained in:
zhaoyingbo 2024-10-15 03:28:54 +00:00
parent 6cc5313d2a
commit d25208182b

View File

@ -100,6 +100,13 @@ class LarkCard<
} else if (_.isArray(obj)) {
return obj.map(traverseAndReplace)
} else if (_.isObject(obj)) {
// 给 value 字段注入公共变量
if ((obj as any).value && variables.commonValue) {
;(obj as any).value = {
...variables.commonValue,
...((obj as any).value || {}),
}
}
return _.mapValues(obj, traverseAndReplace)
}
return obj