7 changed files with 72 additions and 65 deletions
-
3.env
-
3.gitignore
-
4package-lock.json
-
2package.json
-
13src/App.tsx
-
59src/pages/system/Setting.tsx
-
53src/store/system/systemSlice.ts
@ -1,2 +1 @@ |
|||
REACT_APP_WS_URL=127.1.1.0:8080/ws |
|||
PORT= 3000 |
|||
REACT_APP_WS_URL=192.168.1.127:8080/ws |
@ -1,35 +1,36 @@ |
|||
// counterSlice.ts 文件
|
|||
import { createSlice } from "@reduxjs/toolkit"; |
|||
const initialState = { |
|||
systemInfo:[], |
|||
orgInfo:{ |
|||
id:'', |
|||
name:'', |
|||
value:'', |
|||
code:'' |
|||
}, |
|||
accountInfo:{ |
|||
id:'', |
|||
name:'', |
|||
value:'', |
|||
code:'' |
|||
} |
|||
systemInfo:[], |
|||
orgInfo:{ |
|||
id:'', |
|||
name:'', |
|||
value:'', |
|||
code:'' |
|||
}, |
|||
accountInfo:{ |
|||
id:'', |
|||
name:'', |
|||
value:'', |
|||
code:'' |
|||
} |
|||
}; |
|||
// 创建一个 Slice
|
|||
export const systemStateSlice = createSlice({ |
|||
name: "systemState", |
|||
initialState, |
|||
reducers: { |
|||
updateSystemAllState: (state, { payload }) => { |
|||
state.systemInfo = payload |
|||
}, |
|||
updateSystemOrgState: (state, { payload }) => { |
|||
state.orgInfo = payload |
|||
}, |
|||
updateSystemAccountState: (state, { payload }) => { |
|||
state.accountInfo = payload |
|||
}, |
|||
}, |
|||
name: "systemState", |
|||
initialState, |
|||
reducers: { |
|||
updateSystemAllState: (state, { payload }) => { |
|||
state.systemInfo = payload |
|||
}, |
|||
updateSystemOrgState: (state, { payload }) => { |
|||
console.log('systemState.orgInfo------11----', payload) |
|||
state.orgInfo = payload |
|||
}, |
|||
updateSystemAccountState: (state, { payload }) => { |
|||
state.accountInfo = payload |
|||
}, |
|||
}, |
|||
}); |
|||
export const {updateSystemAllState, updateSystemOrgState, updateSystemAccountState } = systemStateSlice.actions; |
|||
// 默认导出
|
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue