添加清理打开过的文件缓存

This commit is contained in:
Aicirou 2020-05-30 19:50:48 +08:00
parent 6f35b90c88
commit c8cbb4ccef

View File

@ -21,11 +21,20 @@ export default {
}, },
methods: { methods: {
cleanCache() { cleanCache() {
new Promise((resolve) => {
Object.keys(localStorage).forEach((item) => {
if (item.indexOf("file_path_") !== -1) {
localStorage.removeItem(item);
}
});
resolve();
}).then(() => {
this.$notify({ this.$notify({
title: this.$t("notify.title"), title: this.$t("notify.title"),
message: this.$t("setting.clear.success"), message: this.$t("setting.clear.success"),
type: "success", type: "success",
}); });
});
}, },
}, },
}; };