From a8b0eada07bfcf0ef9e838a2d2a928f767754f89 Mon Sep 17 00:00:00 2001 From: luke Date: Thu, 29 May 2025 14:52:35 +0800 Subject: [PATCH] =?UTF-8?q?v1.5.0=20=E4=BF=AE=E5=A4=8D=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- pages/index.html | 14 +++----------- pages/index.js | 8 ++++++++ 3 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 pages/index.js diff --git a/manifest.json b/manifest.json index d4ffa97..665a3f3 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "渠道应用开发部知识库", - "version": "1.3.3", + "version": "1.5.0", "description": "通过关键词快速搜索内部文档", "permissions": ["storage"], "host_permissions": [ diff --git a/pages/index.html b/pages/index.html index 6bf9801..49be53e 100644 --- a/pages/index.html +++ b/pages/index.html @@ -3,18 +3,10 @@ 加载中... - + -
正在加载,请稍候...
+
正在加载,请稍候...
+ diff --git a/pages/index.js b/pages/index.js new file mode 100644 index 0000000..0129e5c --- /dev/null +++ b/pages/index.js @@ -0,0 +1,8 @@ +chrome.storage.local.get(["token", "loginAt"], (res) => { + const maxAge = 24 * 60 * 60 * 1000; + const now = Date.now(); + const popup = (!res.token || !res.loginAt || (now - res.loginAt > maxAge)) + ? "pages/login.html" + : "pages/popup.html"; + window.location.href = chrome.runtime.getURL(popup); +});