Skip to content

Commit 56937ef

Browse files
committed
优化 代码
1 parent 8d3eda9 commit 56937ef

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

V2ex-Enhanced.user.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,14 @@
222222
document.getElementById('gift_v2excellent').click();
223223
GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较
224224
} else { // 都没有找到,说明已经签过到了
225-
console.log('已经签过到了。')
225+
console.info('[V2EX 增强] 已经签过到了。')
226226
}
227227
} else { // 不在首页
228228
let timeOld = GM_getValue('menu_clockInTime')
229229
if (!timeOld || timeOld != timeNow) {
230230
qianDaoStatus_(timeNow) // 后台获取签到状态(并判断是否需要签到)
231231
} else { // 新旧签到时间一致
232-
console.log('已经签过到了。')
232+
console.info('[V2EX 增强] 已经签过到了。')
233233
}
234234
}
235235
}
@@ -247,13 +247,14 @@
247247
if (html.querySelector('li.fa.fa-ok-sign')) {
248248
html = html.getElementById('Main').innerText.match(/ (\d+?) /)[0];
249249
GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较
250-
console.log('自动签到完成!')
250+
console.info('[V2EX 增强] 自动签到完成!')
251251
if (qiandao) {
252252
qiandao.innerText = `自动签到完成!${html}`;
253253
qiandao.href = '#';
254254
}
255255
} else {
256256
GM_notification({text: '自动签到失败!请联系作者解决!', timeout: 4000, onclick() {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/424246/feedback', {active: true,insert: true,setParent: true});}});
257+
console.warn('[V2EX 增强] 自动签到失败!请联系作者解决!')
257258
if (qiandao) qiandao.innerText = '自动签到失败!请尝试手动签到!';
258259
}
259260
}
@@ -272,7 +273,7 @@
272273
if (html.querySelector('input[value^="领取"]')) { // 还没有签到...
273274
qianDao_(null, timeNow); // 后台签到
274275
} else { // 已经签到了...
275-
console.log('已经签过到了。')
276+
console.info('[V2EX 增强] 已经签过到了。')
276277
GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较
277278
}
278279
}

0 commit comments

Comments
 (0)