This project is initialized with Ant Design Pro.
一个简单的电商商品管理后台。
修改 config,添加
history: 'hash', // 使用hash模式,默认是browser
base: '/Sale-Admin/', // 指定跟路径
publicPath: '/Sale-Admin/', // 指定公共静态资源目录
// 参考更多:https://pro.ant.design/docs/deploy-cn
[特卖商城后台管理] http://www.2048888.xyz/sale-admin/
[国内资源加速] https://lightzhu.gitee.io/sale-admin
Install node_modules
:
npm install
or
yarn
解决一些安装报错
npm install --no-optional
Ant Design Pro provides some useful script to help you quick start and build with web project, code style check and test.
Scripts provided in package.json
. It's safe to modify or add additional script:
npm start
npm run build
npm run lint
You can also use script to auto fix some lint error:
npm run lint:fix
npm test
-
dva 的 connect 方法中使用到了 dva-loading,会自动在 reducers 中的 state 新增了 loading 对象,
-
请求前:global 为 false,effects 和 models 为空对象 laoding: { effects: {} global: false models: {} }
-
请求中: global 为 true; effects 的 key 为 dispatch 的 type 值,value 为 true; models 的 key 为 namespace 值,value 为 true
-
loading: { effects: {users/user/fetch: true} global: true models: {users: true} }
-
请求完成: global 为 false; effects 的 key 为 dispatch 的 type 值,value 为 false; models 的 key 为 namespace 值,value false;
-
loading: { effects: {users/user/fetch: false} global: false models: {users: false} }