This commit is contained in:
Vanessa 2022-10-30 09:52:18 +08:00
parent 18415517bb
commit fc08e01de2
5 changed files with 7 additions and 8 deletions

View file

@ -137,12 +137,12 @@ export const setLocalStorage = () => {
fetchPost("/api/system/getLocalStorage", undefined, (response) => {
Object.keys(response.data).forEach(item => {
window.localStorage.setItem(item, response.data[item]);
})
});
});
}
};
export const exportLocalStorage = (cb: () => void) => {
fetchPost("/api/system/setLocalStorage", {val: JSON.stringify(localStorage)}, (response) => {
fetchPost("/api/system/setLocalStorage", {val: JSON.stringify(localStorage)}, () => {
cb();
});
}
};