From c8cbb4ccefed58827801231ddfc3578b64599410 Mon Sep 17 00:00:00 2001 From: Aicirou <2643053021@qq.com> Date: Sat, 30 May 2020 19:50:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B8=85=E7=90=86=E6=89=93?= =?UTF-8?q?=E5=BC=80=E8=BF=87=E7=9A=84=E6=96=87=E4=BB=B6=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/header-setting/index.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/layout/header-aside/components/header-setting/index.vue b/src/layout/header-aside/components/header-setting/index.vue index be6b737..a760da2 100644 --- a/src/layout/header-aside/components/header-setting/index.vue +++ b/src/layout/header-aside/components/header-setting/index.vue @@ -21,10 +21,19 @@ export default { }, methods: { cleanCache() { - this.$notify({ - title: this.$t("notify.title"), - message: this.$t("setting.clear.success"), - type: "success", + new Promise((resolve) => { + Object.keys(localStorage).forEach((item) => { + if (item.indexOf("file_path_") !== -1) { + localStorage.removeItem(item); + } + }); + resolve(); + }).then(() => { + this.$notify({ + title: this.$t("notify.title"), + message: this.$t("setting.clear.success"), + type: "success", + }); }); }, },