|
@@ -13,7 +13,7 @@ import {REQ_STATUS} from "@api/config";
|
|
|
import {
|
|
import {
|
|
|
buildReqReducer, reqChangeEmail,
|
|
buildReqReducer, reqChangeEmail,
|
|
|
reqChangeInfo,
|
|
reqChangeInfo,
|
|
|
- reqChangePass, reqChangePhone, reqCustomLeaveMsg, reqCustomService, reqGameInfo,
|
|
|
|
|
|
|
+ reqChangePass, reqChangePhone, reqCustomLeaveMsg, reqCustomService, reqFavoGet, reqGameInfo,
|
|
|
reqGetRoutes,
|
|
reqGetRoutes,
|
|
|
reqLogin,
|
|
reqLogin,
|
|
|
reqLogout,
|
|
reqLogout,
|
|
@@ -187,8 +187,8 @@ const reducerRoutes=(state,action)=>{
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//favorites
|
|
//favorites
|
|
|
- let favorites=getFavorites(json.favorites);
|
|
|
|
|
- Object.assign(state, {routes:state.routes,asyncRoutes:data,styles:styles,blocks:blocks,...generData,isLogin:isLogin,userInfo:userInfo,hallServerUrl:hallServerUrl,favorites:favorites});
|
|
|
|
|
|
|
+ // let favorites=getFavorites(json.favorites);
|
|
|
|
|
+ Object.assign(state, {routes:state.routes,asyncRoutes:data,styles:styles,blocks:blocks,...generData,isLogin:isLogin,userInfo:userInfo,hallServerUrl:hallServerUrl});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
const routesStatus=(state,status,arg)=>{
|
|
const routesStatus=(state,status,arg)=>{
|
|
@@ -370,6 +370,20 @@ const reducerUpdateFavoInfo=(state,action,arg)=>{
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+const reducerFavoGet=(state,action,arg)=>{
|
|
|
|
|
+ let payload=action.payload;
|
|
|
|
|
+ if (payload&&payload.code===200){
|
|
|
|
|
+ let data=payload.data;
|
|
|
|
|
+ let favorites=[];
|
|
|
|
|
+ if (data!=null){
|
|
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
|
|
+ let item=data[i];
|
|
|
|
|
+ if(item)favorites.push(item.id);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ state.favorites=favorites;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
//custom
|
|
//custom
|
|
|
export const Main=createSlice({
|
|
export const Main=createSlice({
|
|
|
name: 'main',
|
|
name: 'main',
|
|
@@ -441,7 +455,7 @@ export const Main=createSlice({
|
|
|
state.favorites=favorites;
|
|
state.favorites=favorites;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- localStorageSet(LOCAL_FAVO_IDS,JSON.stringify(favorites));
|
|
|
|
|
|
|
+ // localStorageSet(LOCAL_FAVO_IDS,JSON.stringify(favorites));
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
extraReducers: (builder) => {
|
|
extraReducers: (builder) => {
|
|
@@ -459,6 +473,7 @@ export const Main=createSlice({
|
|
|
buildReqReducer(builder,reqCustomService,reducerCustom,customStatus);
|
|
buildReqReducer(builder,reqCustomService,reducerCustom,customStatus);
|
|
|
buildReqReducer(builder,reqCustomLeaveMsg,reducerCustomLeaveMsg,customLeaveMsgStatus);
|
|
buildReqReducer(builder,reqCustomLeaveMsg,reducerCustomLeaveMsg,customLeaveMsgStatus);
|
|
|
buildReqReducer(builder,reqUpdateFavoInfo,reducerUpdateFavoInfo,null);
|
|
buildReqReducer(builder,reqUpdateFavoInfo,reducerUpdateFavoInfo,null);
|
|
|
|
|
+ buildReqReducer(builder,reqFavoGet,reducerFavoGet,null);
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
export const {logout,updateUserInfo,updateUserScore,updateAddScore,updateGameLike} = Main.actions;
|
|
export const {logout,updateUserInfo,updateUserScore,updateAddScore,updateGameLike} = Main.actions;
|