added: 系统初始化

This commit is contained in:
none
2023-03-23 11:32:38 +08:00
parent 0fabdf7da7
commit c97a2529a8
5 changed files with 73 additions and 4 deletions

View File

@@ -1,9 +1,11 @@
import { configureStore } from "@reduxjs/toolkit";
import systemConfigReducer from "./system/systemConfigSlice";
import loginUserReducer from "./user/loginUserSlice";
const store = configureStore({
reducer: {
loginUser: loginUserReducer,
systemConfig: systemConfigReducer,
},
});

View File

@@ -0,0 +1,34 @@
import { createSlice } from "@reduxjs/toolkit";
type SystemConfigStoreInterface = {
systemApiUrl: string;
systemPcUrl: string;
systemH5Url: string;
systemLogo: string;
systemName: string;
};
let defaultValue: SystemConfigStoreInterface = {
systemApiUrl: "",
systemPcUrl: "",
systemH5Url: "",
systemLogo: "",
systemName: "",
};
const systemConfigSlice = createSlice({
name: "systemConfig",
initialState: {
value: defaultValue,
},
reducers: {
saveConfigAction(stage, e) {
stage.value = e.payload;
},
},
});
export default systemConfigSlice.reducer;
export const { saveConfigAction } = systemConfigSlice.actions;
export type { SystemConfigStoreInterface };