react-project(二)

一、package.json中的配置

1.babel-plugin-import可以实现antd-mobile的按需加载

"babel-plugin-import": "^1.6.3"
 
"plugins": [
      [
        "import",
        {
"libraryName": "antd-mobile",
          "style": "css"
        }
      ],
        "transform-decorators-legacy "
    ]
 
2."transform-decorators-legacy "支持redux装饰器的@写法的插件
3.前端webpack的接口是3000,后端express的接口是9093,如果前端直接调用后端,会发生跨域错误。所以,我们在本地3000的接口做一次转发,所有的请求都发送到了9093,这样我们就能调取nodeJS的接口。
"proxy": "http://localhost:9093"
4."cookie-parser": "^1.4.3"处理cookie
二、登陆注册页面实现
1.忘安装redux模块
2.thunk引入错误 正确:import thunk from 'redux-thunk';
3.proxy error
重新安装npm install --save-dev babel-plugin-transform-decorators-legacy
"transform-decorators-legacy"要放在其他的前面
服务没有启动
 4.引入装饰器问题
https://github.com/Microsoft/vscode/issues/28097#issuecomment-306560817
5.安装utility库可以支持密码加密 md5
6.安装body-parser库
 
posted @ 2017-12-19 22:53  张若昀的小迷妹  阅读(250)  评论(2编辑  收藏  举报