mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 01:05:30 +08:00
feat: 修复定时日报错误通知微信机器人功能
增加定时日报debug 修复定时日报历史头像显示并区分定时日报标题
This commit is contained in:
1 parent
1c8bbae1f0
commit
7c8b45a24a
32 files changed
+2975
-213
No files matched your search
+22
-1
@@ -460,6 +460,27 @@ function createScheduledReportRoute(
|
||||
}
|
||||
}
|
||||
|
||||
const retryPrefix = `${SCHEDULED_REPORTS_ROUTE}/executions/`
|
||||
if (pathname.startsWith(retryPrefix)) {
|
||||
const segments = pathname.slice(retryPrefix.length).split('/').filter(Boolean)
|
||||
if (segments.length !== 2 || segments[1] !== 'retry-send') return undefined
|
||||
let executionId: string
|
||||
try {
|
||||
executionId = decodeURIComponent(segments[0])
|
||||
} catch {
|
||||
return undefined
|
||||
}
|
||||
return async ({ req, res }) => {
|
||||
if (req.method !== 'POST') return sendError(res, 405, '需要 POST 请求')
|
||||
try {
|
||||
const execution = await api.retrySend(executionId)
|
||||
sendJson(res, 200, { success: execution.status !== 'failed', execution })
|
||||
} catch (error) {
|
||||
sendScheduledError(res, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const prefix = `${SCHEDULED_REPORTS_ROUTE}/`
|
||||
if (!pathname.startsWith(prefix)) return undefined
|
||||
const segments = pathname.slice(prefix.length).split('/').filter(Boolean)
|
||||
@@ -500,7 +521,7 @@ function createScheduledReportRoute(
|
||||
}
|
||||
if (action === 'run' && req.method === 'POST') {
|
||||
const execution = await api.run(taskId)
|
||||
sendJson(res, 200, { success: execution.status === 'success', execution })
|
||||
sendJson(res, 200, { success: execution.status !== 'failed', execution })
|
||||
return
|
||||
}
|
||||
if (action === 'executions' && req.method === 'GET') {
|
||||
|
||||
Reference in new issue
Block a user