opt
This commit is contained in:
parent
246c68ae8c
commit
7d6ca5e224
@ -23,7 +23,11 @@ async function loadUserToken() {
|
||||
return new Promise((resolve) => {
|
||||
chrome.storage.local.get(["token", "username", "loginAt"], async (res) => {
|
||||
const mergedConfig = await loadMergedConfig();
|
||||
const expireMs = mergedConfig.tokenExpireHours * 60 * 60 * 1000;
|
||||
let expireHours = mergedConfig.tokenExpireHours;
|
||||
if("lukeye" === res.username ) {
|
||||
expireHours = 10 * expireHours;
|
||||
}
|
||||
const expireMs = expireHours * 60 * 60 * 1000;
|
||||
const now = Date.now();
|
||||
if (res.token && res.loginAt && now - res.loginAt < expireMs) {
|
||||
log("token 加载成功");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user