Skip to content

Commit

Permalink
fix: 处理数据操作触发器参数中 _id 类型不为 string 的问题;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Jul 15, 2021
1 parent fdf297b commit 9360fa8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/faas/trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ accessor.on('result', AccessorEventCallBack)
* @param data
*/
export function AccessorEventCallBack(data: any) {
const { params, result } = data
// 解决 mongodb _id 对象字符串问题
const _data = JSON.parse(JSON.stringify(data))

const { params, result } = _data

const op = convertActionType(params.action)

Expand Down

0 comments on commit 9360fa8

Please sign in to comment.