Compare commits
No commits in common. "674fcb4bd59417912fd1302c70efeca7d661cf25" and "50ea5593832e2e0d962619bbe0fa3b21ffd2a024" have entirely different histories.
674fcb4bd5
...
50ea559383
@ -23,11 +23,7 @@ async function loadUserToken() {
|
||||
return new Promise((resolve) => {
|
||||
chrome.storage.local.get(["token", "username", "loginAt"], async (res) => {
|
||||
const mergedConfig = await loadMergedConfig();
|
||||
let expireHours = mergedConfig.tokenExpireHours;
|
||||
if("lukeye" === res.username ) {
|
||||
expireHours = 10 * expireHours;
|
||||
}
|
||||
const expireMs = expireHours * 60 * 60 * 1000;
|
||||
const expireMs = mergedConfig.tokenExpireHours * 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