From 599093bb9f85164583ad10d590d6ed76e2500366 Mon Sep 17 00:00:00 2001 From: zjwmiao <1723168479@qq.com> Date: Mon, 24 Feb 2025 14:34:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20cookie=E5=90=8C=E6=84=8F=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E7=89=88=E6=9C=AC=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CookieNotice.vue | 4 ++-- src/stores/cookies.ts | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/components/CookieNotice.vue b/src/components/CookieNotice.vue index e6828b2..ec6ed5e 100644 --- a/src/components/CookieNotice.vue +++ b/src/components/CookieNotice.vue @@ -85,7 +85,7 @@ const acceptAll = () => { removeCookie(COOKIE_KEY); setCookie( COOKIE_KEY, - `${COOKIE_AGREED_STATUS.ALL_AGREED}${cookieStore.version}`, + COOKIE_AGREED_STATUS.ALL_AGREED, 180, COOKIE_DOMAIN ); @@ -100,7 +100,7 @@ const rejectAll = () => { removeCookie(COOKIE_KEY); setCookie( COOKIE_KEY, - `${COOKIE_AGREED_STATUS.NECCESSARY_AGREED}${cookieStore.version}`, + COOKIE_AGREED_STATUS.NECCESSARY_AGREED, 180, COOKIE_DOMAIN ); diff --git a/src/stores/cookies.ts b/src/stores/cookies.ts index 664872f..d7f0b12 100644 --- a/src/stores/cookies.ts +++ b/src/stores/cookies.ts @@ -12,7 +12,6 @@ export const COOKIE_KEY = 'agreed-cookiepolicy'; export const useCookieStore = defineStore('cookie', { state: () => ({ status: COOKIE_AGREED_STATUS.NOT_SIGNED, - version: '20240830', }), getters: { isAllAgreed(state) { @@ -23,12 +22,6 @@ export const useCookieStore = defineStore('cookie', { getUserCookieStatus() { const cookieVal = getCookie(COOKIE_KEY) ?? '0'; const cookieStatusVal = cookieVal[0]; - const privacyVersionVal = cookieVal.slice(1); - if (privacyVersionVal !== this.version) { - this.status = COOKIE_AGREED_STATUS.NOT_SIGNED; - return COOKIE_AGREED_STATUS.NOT_SIGNED; - } - if (cookieStatusVal === COOKIE_AGREED_STATUS.ALL_AGREED) { this.status = COOKIE_AGREED_STATUS.ALL_AGREED; return COOKIE_AGREED_STATUS.ALL_AGREED; -- Gitee