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); +});