v1.5.0 修复报错日志
This commit is contained in:
parent
ed1fd2898c
commit
a8b0eada07
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "渠道应用开发部知识库",
|
"name": "渠道应用开发部知识库",
|
||||||
"version": "1.3.3",
|
"version": "1.5.0",
|
||||||
"description": "通过关键词快速搜索内部文档",
|
"description": "通过关键词快速搜索内部文档",
|
||||||
"permissions": ["storage"],
|
"permissions": ["storage"],
|
||||||
"host_permissions": [
|
"host_permissions": [
|
||||||
|
|||||||
@ -3,18 +3,10 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8"/>
|
<meta charset="UTF-8"/>
|
||||||
<title>加载中...</title>
|
<title>加载中...</title>
|
||||||
<script>
|
<link rel="stylesheet" href="styles.css"/>
|
||||||
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);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div style="padding: 1rem; font-size: 14px;">正在加载,请稍候...</div>
|
<div style="padding: 1rem; font-size: 14px;">正在加载,请稍候...</div>
|
||||||
|
<script src="index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
8
pages/index.js
Normal file
8
pages/index.js
Normal file
@ -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);
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user