You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.0 KiB

  1. // counterSlice.ts 文件
  2. import { createSlice } from "@reduxjs/toolkit";
  3. const initialState = {
  4. systemInfo:[],
  5. orgInfo:{
  6. id:'',
  7. name:'',
  8. value:'',
  9. code:''
  10. },
  11. accountInfo:{
  12. id:'',
  13. name:'',
  14. value:'',
  15. code:''
  16. },
  17. uploadServerUrl: {
  18. id:'',
  19. name:'',
  20. value:'',
  21. code:''
  22. }
  23. };
  24. // 创建一个 Slice
  25. export const systemStateSlice = createSlice({
  26. name: "systemState",
  27. initialState,
  28. reducers: {
  29. updateSystemAllState: (state, { payload }) => {
  30. state.systemInfo = payload
  31. },
  32. updateSystemOrgState: (state, { payload }) => {
  33. state.orgInfo = payload
  34. },
  35. updateSystemAccountState: (state, { payload }) => {
  36. state.accountInfo = payload
  37. },
  38. updateUploadServerUrlState: (state, { payload }) => {
  39. state.uploadServerUrl = payload
  40. }
  41. },
  42. });
  43. export const {updateSystemAllState, updateSystemOrgState, updateSystemAccountState, updateUploadServerUrlState } = systemStateSlice.actions;
  44. // 默认导出
  45. export default systemStateSlice.reducer;