From 997d1101b55f550e65cb9be53527fce04d37472a Mon Sep 17 00:00:00 2001 From: endigo Date: Wed, 25 Nov 2020 22:04:29 +0800 Subject: [PATCH] add path option on cookie.remove --- packages/core/src/UniversalStorage/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/src/UniversalStorage/index.ts b/packages/core/src/UniversalStorage/index.ts index 754049dea86..2a9edaf8ad4 100644 --- a/packages/core/src/UniversalStorage/index.ts +++ b/packages/core/src/UniversalStorage/index.ts @@ -26,7 +26,7 @@ export class UniversalStorage implements Storage { clear() { Array.from(new Array(this.length)) - .map((value, i) => this.key(i)) + .map((_, i) => this.key(i)) .forEach(key => this.removeItem(key)); } @@ -58,7 +58,9 @@ export class UniversalStorage implements Storage { } protected removeUniversalItem(key: keyof Store) { - this.cookies.remove(key); + this.cookies.remove(key, { + path: '/', + }); } setItem(key: keyof Store, value: string) {