From 51d2103992713e8b2a007c9a3bc65256f664c5d1 Mon Sep 17 00:00:00 2001 From: Scott Liu Date: Fri, 8 Jan 2021 16:20:15 +0800 Subject: [PATCH] fix: `expires` in cookieOption should not always overridden by default value --- src/components/CookieLaw.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/CookieLaw.vue b/src/components/CookieLaw.vue index 0f59900..1fc2b8a 100644 --- a/src/components/CookieLaw.vue +++ b/src/components/CookieLaw.vue @@ -156,21 +156,21 @@ if (this.canUseLocalStorage) { localStorage.setItem(this.storageName, true) } else { - Cookie.set(this.storageName, true, { ...this.cookieOptions, expires: '1Y' }) + Cookie.set(this.storageName, true, { expires: '1Y', ...this.cookieOptions }) } }, setAccepted () { if (this.canUseLocalStorage) { localStorage.setItem(this.storageName, true) } else { - Cookie.set(this.storageName, true, { ...this.cookieOptions, expires: '1Y' }) + Cookie.set(this.storageName, true, { expires: '1Y', ...this.cookieOptions }) } }, setDeclined () { if (this.canUseLocalStorage) { localStorage.setItem(this.storageName, false) } else { - Cookie.set(this.storageName, false, { ...this.cookieOptions, expires: '1Y' }) + Cookie.set(this.storageName, false, { expires: '1Y', ...this.cookieOptions }) } }, getVisited () {