Express.js :获取同一源 iframe 的 req.body.datas



因为嵌套表单是一种不好的做法,所以我从我的网站源代码制作了一个内部 iframe 来加载另一个表单。因为它的内部我有添加样式和所有内容,但是在发布低谷快递时(我也使用 sequelize 来创建我的实体(,即使加载了返回页面,我的数据也是空的。是我想念的东西吗?也许我必须指定 req.accepts((,我问是否有人知道这种问题。

app.post('/sendOwners', function (req, res) {
ownerController
//these are empty even filled from the front end
.create(req, res, req.body.name,req.body.firstname, req.body.civility) 
.then(function(owner){
res.send('contenu owner' +owner +'contenu req:'+req.body)
})
})

我的内嵌框架

<iframe id="iframeID"
name="_parent"
sandbox="allow-forms allow-same-origin"
src="owners"
></iframe>

我在网上没有找到关于这个主题的明确回应。我必须找到一种方法,几个小时后,我终于将方法形式更改为"get"并使用 req.query 访问我的数据。它现在似乎有效。

最新更新