Compare commits

...

2 Commits

Author SHA1 Message Date
95a9b40939 chore(release): publish
- @egg/lark-msg-tool@1.11.0
2024-10-15 03:29:17 +00:00
d25208182b feat(lark-msg): genCard支持给value字段注入公共变量
All checks were successful
/ release (push) Successful in 23s
2024-10-15 03:28:54 +00:00
4 changed files with 15 additions and 2 deletions

2
package-lock.json generated
View File

@ -12122,7 +12122,7 @@
},
"packages/lark-msg-tool": {
"name": "@egg/lark-msg-tool",
"version": "1.10.0",
"version": "1.11.0",
"license": "ISC",
"dependencies": {
"@egg/logger": "^1.4.4",

View File

@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.11.0](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/lark-msg-tool@1.10.0...@egg/lark-msg-tool@1.11.0) (2024-10-15)
### Features
- **lark-msg:** genCard支持给value字段注入公共变量 ([d252081](http://yingbo.im:3000/zhaoyingbo/egg_tools/commits/d25208182b81f518e97da261e600cd20f6469bcc))
# [1.10.0](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/lark-msg-tool@1.9.0...@egg/lark-msg-tool@1.10.0) (2024-10-15)
### Features

View File

@ -1,6 +1,6 @@
{
"name": "@egg/lark-msg-tool",
"version": "1.10.0",
"version": "1.11.0",
"description": "Lark Msg Tools for Egg projects",
"type": "module",
"main": "src/index.ts",

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