如何使用React JS,Redux和Express进行身份validation?

新的反应JS,REDX和expression。

我做了一个简单的login/注册应用程序使用反应js,redux,webpack和快递。 目前,视图/组件已经创build并正在运行。

我需要能够存储用户信息,“电子邮件”和“密码”是所有需要注册。

有没有这样的例子,我可以看看实施到我的解决scheme?

我不确定这是否是你正在寻找,但你可以在你的反应组件中做到以下几点:

注意这只是一个例子,如何做到没有同构的JavaScript

... componentDidMount(){ this.getUserInitData() } ... getUserInitData(){ // here you make a simple AJAX request to the server to get the data $.get('/api/get/user/init', function(result){ console.log(result) // now result contains whatever information your server will respond with // this could be your user authentication data for example. // Now you can go ahead and store the result into your state }); }