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
45 lines
1.0 KiB
// counterSlice.ts 文件
|
|
import { createSlice } from "@reduxjs/toolkit";
|
|
const initialState = {
|
|
systemInfo:[],
|
|
orgInfo:{
|
|
id:'',
|
|
name:'',
|
|
value:'',
|
|
code:''
|
|
},
|
|
accountInfo:{
|
|
id:'',
|
|
name:'',
|
|
value:'',
|
|
code:''
|
|
},
|
|
uploadServerUrl: {
|
|
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
|
|
},
|
|
updateUploadServerUrlState: (state, { payload }) => {
|
|
state.uploadServerUrl = payload
|
|
}
|
|
},
|
|
});
|
|
export const {updateSystemAllState, updateSystemOrgState, updateSystemAccountState, updateUploadServerUrlState } = systemStateSlice.actions;
|
|
// 默认导出
|
|
export default systemStateSlice.reducer;
|