我是 react 和 redux 的新手,我正在尝试使用创建新帖子this.props.match.params.id
componentDidMount()
{
this.props.dispatch(userActions.getAll(this.props.match.params.id));
}
....................
<button type="button"
onClick={() => dispatch({ type: "ADD_NEW_POST",
id: this.props.match.params.id })} >Save
</button>
this.props.match.params.id我的问题是,我为 CRUD 应用程序使用了多少安全性?
编辑
我的链接是<Link to={`/addpost/${item.id}`}>Rooms</Link>,然后我们使用getAll(this.props.match.params.id)上面的代码提交
在nodejs中,
router.post('/addpost/:id', (req, res, next) =>{
Users.findById(req.params.id, function (err, data) {
..............
..............