index.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-12-22 09:36:53
  4. * @LastEditTime: 2021-12-22 09:48:30
  5. * @LastEditors: Please set LastEditors
  6. * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  7. * @FilePath: /KC-MiddlePlatform/src/models/model.ts
  8. */
  9. // import { Effect, Reducer, Subscription } from 'umi';
  10. // export interface IndexModelState {
  11. // name: string;
  12. // }
  13. // export interface IndexModelType {
  14. // namespace: 'index';
  15. // state: IndexModelState;
  16. // effects: {
  17. // query: Effect;
  18. // };
  19. // reducers: {
  20. // save: Reducer<IndexModelState>;
  21. // // 启用 immer 之后
  22. // // save: ImmerReducer<IndexModelState>;
  23. // };
  24. // subscriptions: { setup: Subscription };
  25. // }
  26. // const IndexModel: IndexModelType = {
  27. // namespace: 'index',
  28. // state: {
  29. // name: '',
  30. // },
  31. // effects: {
  32. // *query({ payload }, { call, put }) {},
  33. // },
  34. // reducers: {
  35. // save(state, action) {
  36. // return {
  37. // ...state,
  38. // ...action.payload,
  39. // };
  40. // },
  41. // // 启用 immer 之后
  42. // // save(state, action) {
  43. // // state.name = action.payload;
  44. // // },
  45. // },
  46. // subscriptions: {
  47. // setup({ dispatch, history }) {
  48. // return history.listen(({ pathname }) => {
  49. // if (pathname === '/') {
  50. // dispatch({
  51. // type: 'query',
  52. // });
  53. // }
  54. // });
  55. // },
  56. // },
  57. // };
  58. // export default IndexModel;