当我使用模式验证器作为中间件时,快速验证器正在修改请求的正文。
客户发布了此信息:
form:
{
permission: [{'1': 'asdf'}],
project_id: '98293949-c650-46d9-8bdb-fc57fb30fd88',
task_id: '86325d50-7813-40ae-a8f9-7ddaf3f1790d',
user_id: 'uvjKMSB0euYrCy45XhmpuQEQaZF2'
} as any
但这是我在console.log req.body时得到的
res.send('the api is working'+JSON.stringify(req.body),);
api是 working {“ permission [0] [1]”:“ asdf”,“ project_id”:“ 98293949-c650-46d9-8bdb-fc57fb30fd88”,“ task_id”:“ 86325d50-7813-40ae-a8f9-7ddaf3f1790d”,“ user_id “:” uvjKMSB0euYrCy45XhmpuQEQaZF2“}
如何防止权限变为权限[0] [1] 而不是实际数组?