mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-12-23 07:09:34 +08:00
added: 系统初始化
This commit is contained in:
@@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
34
src/store/system/systemConfigSlice.ts
Normal file
34
src/store/system/systemConfigSlice.ts
Normal 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 };
|
||||
Reference in New Issue
Block a user