fixed:keep local accessCode

This commit is contained in:
cbmland
2024-07-13 20:15:42 +08:00
parent 119f0a94d2
commit c621662aae
4 changed files with 21 additions and 22 deletions

View File

@@ -119,14 +119,12 @@ const MergeStates: StateMerger = {
};
export function getLocalAppState() {
const accessStore = useAccessStore();
const appState = Object.fromEntries(
Object.entries(LocalStateGetters).map(([key, getter]) => {
return [key, getter()];
}),
) as AppState;
appState["access-control"].accessCode = accessStore.accessCode
return appState;
}
@@ -140,10 +138,10 @@ export function mergeAppState(localState: AppState, remoteState: AppState) {
Object.keys(localState).forEach(<T extends keyof AppState>(k: string) => {
const key = k as T;
//if(k !== ''){
console.log('mergeAppState',k)
const localStoreState = localState[key];
const remoteStoreState = remoteState[key];
MergeStates[key](localStoreState, remoteStoreState);
console.log("mergeAppState", k);
const localStoreState = localState[key];
const remoteStoreState = remoteState[key];
MergeStates[key](localStoreState, remoteStoreState);
//}
});