From 31c3fd98c8508ffaa225682e046df3282b15071e Mon Sep 17 00:00:00 2001 From: gitea Date: Mon, 30 Dec 2024 06:40:32 +0000 Subject: [PATCH] update --- static/js/main.js | 14 ++++++++++++++ templates/base.html | 1 + 2 files changed, 15 insertions(+) diff --git a/static/js/main.js b/static/js/main.js index 8b137891..8fcfb405 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1 +1,15 @@ +function getCookie(name) { + let cookieValue = null; + if (document.cookie && document.cookie !== '') { + const cookies = document.cookie.split(';'); + for (let cookie of cookies) { + cookie = cookie.trim(); + if (cookie.substring(0, name.length + 1) === (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; +} diff --git a/templates/base.html b/templates/base.html index 22aaba2a..47aa2a31 100644 --- a/templates/base.html +++ b/templates/base.html @@ -701,6 +701,7 @@ +